Slavi 94 Master Poster Featured Poster

Try to make a maze solver, will keep you busy for a bit and you'll get quite some experience with it I hope ( Should be able to do after watching those vids) such as , S = start position, G = goal , X = no wall , W = wall and in a maze like this

WXXWX
SXWWG
WXXXX

and print out the correct path :) Also be more creative on the maze once you get it right :D

Slavi 94 Master Poster Featured Poster

this can help you get started

Slavi 94 Master Poster Featured Poster

The second example

Slavi 94 Master Poster Featured Poster

this? assuming windows is used for the executable files

Slavi 94 Master Poster Featured Poster

how about if (yon == "yes")||(yon =="no")||(yon=="Yes")||(yon =="No")

Slavi 94 Master Poster Featured Poster

Again it depends on how many is almost all? 9/10? Also the implementation of the last one, how long does it take for the compiler. I guess you could try and do so but its not a good practice especially if time/efficiency is crutial for your project. And then again in big projects almost all might be 900 out of 1000, will be pointless to really recompile the rest and in my opinion it might make the code itself confusing especially if you work with multiple people. I rather keep things clear and in multiple file so I always only implement what I need

Slavi 94 Master Poster Featured Poster

I think what Mike is trying to explain is that if you have a file that contains 10000 functions inside and you use only 1 or 2 of them, it will be pointless to include the file and compile all functions all the time when they are not needed.

yes, it is possible to do and the answer to your question - yes it is poor convention

Slavi 94 Master Poster Featured Poster

You are trying to declear methods inside the main method. After you declare what you want to have in the main, make sure you close it }. Also its a good practice to always declear your methods public/private instead of leaving them with a default public one

Slavi 94 Master Poster Featured Poster

first do this chmod +x scripName.sh
then run it using this ./scriptName.sh

Slavi 94 Master Poster Featured Poster

Have in mind that c++ is used for all platforms, you have access to memory using pointers. C# is used for making applications for Windows OS, newest .NET versions are really easy to use with or without much experience for creating graphics or animations. Python is a scripting language, as Hiroshe stated it is probably the easiest of those 3 to learn, you can learn the basics using it

qulu.quliyev.58 commented: can I use python for creating object priented programs such as calculator we use in windows ? +0
Slavi 94 Master Poster Featured Poster

This is how you can locate the image in your class folder
private Icon icon = new ImageIcon( getClass().getResource( "ImageName.png" ));

Then you can use the image to create a new Jlabel of it such as
private JLabel jl = new JLabel(icon);

Afterwards you can use the Jlabel to attach it to a Panel or anything you want to do with it

Slavi 94 Master Poster Featured Poster

I'd also say wait for the eye to show up .. avoid real life contacts! :p

Slavi 94 Master Poster Featured Poster

You have to implement what happens if the grade is less than 0. Currently there is nothing and it just won't do anything about it

JeffGrigg commented: Yes; exactly! +6
Slavi 94 Master Poster Featured Poster

Connect to the router. Open cmd type in ipconfig. Find what it says at gateway (possible 192.168.1.1 or 192.168.0.1). Put that into a web browser and u'll get prompt to enter user and pw, I think it is admin and admin for both(At least was for mine if back to default settings) unless try to google what is the default for your router. Once in the GUI you can set up anything you like

Slavi 94 Master Poster Featured Poster

Um, if you want to install it on that hard drive, burn the iso image on a flash stick and then install from flash drive. When asked which drive to install windows 7 on select that drive.The HDD for windows should have NTFS file system. I can give you detailed walk through of doing so if you want to try it( I just installed windows 8.1 on a hard drive that I had Linux only on and it was extremely painful trying to make windows 8.1 to dual boot ..)

Stuugie commented: Thanks I will try as you suggest and get back to you. +5
Slavi 94 Master Poster Featured Poster

e.printStackTrace() in the catch block

Slavi 94 Master Poster Featured Poster

Try this

myPicture = ImageIO.read(getClass().getResource("Companylogo_FINAL.jpg"));

Slavi 94 Master Poster Featured Poster

You compare srtings with the method equals() in the String class
sdr.equals(rds). Equals would check whether the objects are the same, while == checks their references

Slavi 94 Master Poster Featured Poster

When you declare a method, if it throws an exception of some kind, you don't have to use the try/catch block, if its not decleared that it throws an exception then you use try/catch. I'd rather use try/catch in most cases as you can print the strack trace of the exection in the catch, which will help you find/fix your error faster.

In your case what you want to see if it throws an exeption is the if statement itself. Also in the catch block you want to exceptionObject.printStackTrace()

Slavi 94 Master Poster Featured Poster

Your method is missing a return statement, a default one in case it never enters the if statements (Usually, the default return statement doesnt execute in applications that you always have one of the switch inputs, but is needed to satisfy the syntax)

Slavi 94 Master Poster Featured Poster

If they are -1 based, then -1 is first, 0 should be second?

Slavi 94 Master Poster Featured Poster

this code that you have works fine for generating 3 numbers, althought I really dont understand why are you using those mathematical expressions for loterryDigits

import java.util.Scanner;
public class LotteryFixed {
    public static void main(String[] args) {
        int lottery = (int)(Math.random() * 1000);
        Scanner input = new Scanner(System.in);
        System.out.print("Enter your lottery pick (three digits): ");
        int guess = input.nextInt();
        int lotteryDigit1 = lottery / 100;
        int lotteryDigit2 = lottery * 1;
        int lotteryDigit3 = lottery % 10;
        int guessDigit1 = guess / 100;
        int guessDigit2 = guess * 1;
        int guessDigit3 = guess % 10;
        System.out.println("The lottery number is " + lottery);
    }
}

One thing you might want to take a look at is Random class and its method nextInt(), then you can get a random number in for example 0-9 to generate each of the 3 lotteryDigits separately

Also the loterry number is from 0 to 1000, so you get number for lottery 500, then in loterryDigit1 you write 500/100 =5 , then in lotteyDigit2 you write 500*1 = 500, Do you see something weird?

Slavi 94 Master Poster Featured Poster

I am not the most experienced person around here but from my experience so far, it really comes to syntax differences, I had to make a banking system in c++ back in the days as a project using multi inheritance and from what I remember the actual differences were:
-creating and deleting objects in c++ by yourself (new, delete) while java has garbige collection
-in c++ you can inherit from multiple classes, in java not exactly, but you can inherit from multiple interfaces which somewhat gets close to the idea behind c++'s multiple inheritance.
As for inheritance its pretty much the same, you need virtual so that the compiler understands it. Also I think there was something with ambigious call error(usage of virtual) but can't remember much about it, if you want you can check the net about it

Slavi 94 Master Poster Featured Poster

What james said look Here

Slavi 94 Master Poster Featured Poster

I am currently using a Dell laptop for about 2,5 years now ... the only problem that I have with it is overheating, It really starts to burn quite fast :s and even if I not doing anything you can the fan going mad. From what I see Acer is decent(especially if you want to have 2nd OS such as Linux). When i tried running linux on my laptop i could feel the buttons started melting cuz of overheating within like 5 minutes after starting it :D But also I see lately maybe 4 out of 5 people around me having Lenovo Think Pad, they seem pretty satisfied with it

Slavi 94 Master Poster Featured Poster

Interesting task you have there :) I'd assume that you've got it running by now but this is what i'd try

public void actionPerformed(ActionEvent e){
                    bld = (e.getActionCommand());
                    sb.append(bld);
                    if (sb.length()== 3) {
                        input = sb.toString();
                        if (input.equals(pass)){
                            JOptionPane.showMessageDialog(frame,"Success");
                            frame.dispose();
                        }
                        else{
                            JOptionPane.showMessageDialog(frame, "Wrong!");
                            sb.setLength(0);
                            failedAttempts++;
                            if (failedAttempts == 3){
                                JOptionPane.showMessageDialog(frame, "Your have ran out of attempts!");
                                frame.dispose();
                            }
                        }
                    }
                  }
Slavi 94 Master Poster Featured Poster

1) because java has its own syntax that has to be followed upon object creation
2) because you can initialize your class i nthe constructor so whenever you create an object of that class, it will already have assigned parameters and be ready to use(for example GUI's)

Slavi 94 Master Poster Featured Poster

are you trying to multiply each element of the matrix with a corresponding element in the vector? as in element 1 in the matrix * element 1 in the vector?

Slavi 94 Master Poster Featured Poster

If you have to deep into inheritance and polymorphism perhaps bank account system is good to implement

Slavi 94 Master Poster Featured Poster

Rahul's code is completed and it works as expected, I think it is easy to convert it into c++ yourself