318 Posted Topics

Member Avatar for Protoroll
Member Avatar for mishra pradeep

Are you serious? #1. What is a 'wed site'? #2. This is the C++ section. #3. What do you even mean? #4. If you want to learn java, there are many tutorials on the net, just use google. It only wants to help you. #5. No to anything else you …

Member Avatar for javaAddict
0
88
Member Avatar for justinwarner

If you want the boolean to be accesible in both the if and the else statement, you need to define it above them. Just define it as [CODE]boolean buyIt;//make sure you look up scope of variables[/CODE] It defaults to false, so no need to initialise. Now, all you need to …

Member Avatar for ~s.o.s~
0
150
Member Avatar for mike42intn
Member Avatar for ncstplaya1234

But you just posted the steps you need to do, to solve that problem. I don't quite understand what you are asking.

Member Avatar for ncstplaya1234
0
3K
Member Avatar for amit.hak50
Member Avatar for amit.hak50
-1
73
Member Avatar for |hex

You are not testing if the value is true in the while loop. [CODE]}while(again= 'y' || 'Y' );[/CODE] You need an extra = sign to test if values are true or false. [CODE]}while(again== 'y' || again== 'Y' );[/CODE]

Member Avatar for Akill10
0
85
Member Avatar for ronicasingh
Member Avatar for vinay1424

Math.random() produces a number where 0 <= x < 1. Therefore, Math.random()*5, produces a number where 0<=x<5. (So it will pick an index from 0 to 4.). [CODE](int) (Math.random() * 5);[/CODE] The (int) Just casts the value of the random number to type int, doing this 'cuts' off any numbers …

Member Avatar for stultuske
0
116
Member Avatar for wintercold

[QUOTE=Vllinator;1335046]This is a really good tutorial [url]http://xoax.net/comp/cpp/console/Lesson9.php[/url] If this is for a school project, be sure to not just copy the source code and make a few changes - you'll learn nothing that way. Goodluck[/QUOTE] Wow, thanks for that website, i have never seen it before!

Member Avatar for Greywolf333
0
3K
Member Avatar for nix_xin

[url]http://leepoint.net/notes-java/flow/loops/loops.html[/url] Use spaces when you type in english.

Member Avatar for brandonrunyon
0
138
Member Avatar for iw2z
Member Avatar for mike_2000_17
0
264
Member Avatar for busadude

Nice, I'm also from Ireland. Its a bit strange they don't give us keyboards to write our own language properly isn't it. Where is your fada? :D

Member Avatar for Akill10
0
16
Member Avatar for notmasteryet

[QUOTE=notmasteryet;1334659]Lol... I kno that.[/QUOTE] Well then, Do you expect us to look into [B]your[/B] future, find out the different types of problems you will face in class, and explain them to you now? There is nothing more we can tell you about starting a program. It all depends on what …

Member Avatar for Fbody
0
359
Member Avatar for boiishuvo
Member Avatar for geeks
Member Avatar for dem10

ERROR #1: In your constructor: [CODE] public BankAccount(String a, double b, double c)//You need to assign a variable to each type otherwise nothing is storing the value and it won't compile { } [/CODE] ERROR #2: [CODE]# public abstract void updateBalance(); { //You need to un-comment the braces and close …

Member Avatar for stephen84s
0
128
Member Avatar for Syrne

Your trying to compare letters, not numbers. [CODE]int select;//should be char or string[/CODE] [CODE]if(select.equals('Y')) {//return a value} if(no) {//return a value}[/CODE]

Member Avatar for Syrne
0
7K
Member Avatar for qtbugfrmmo
Member Avatar for pa_bruce_fan

[url]http://msdn.microsoft.com/en-us/library/czs2584d.aspx[/url] Maybe this will help you. :)

Member Avatar for Akill10
0
115
Member Avatar for Nandomo

Why are you using a boolean? Your program doesn't even compile for me. Do you realise you are trying to assign 2 booleans to a single integer?

Member Avatar for Nandomo
0
128
Member Avatar for morancr

Well, first of all, your withdraw method is wrong. You have: [CODE]if (withdraw >= balance)[/CODE] but you haven't initialised the withdraw variable. You don't even use it.

Member Avatar for jon.kiparsky
0
96
Member Avatar for blknmld69
Member Avatar for gudads

[QUOTE=extemer;1332670]import javax.swing.*; import java.util.*; class stringdemo { public static void main(String[] args) { Scanner input = new Scanner(System.in); System.out.print("enter num1\n"); int num1 = input.nextInt(); System.out.print("enter num2\n"); int num2 = input.nextInt(); System.out.print("enter num3\n"); int num3 = input.nextInt(); System.out.print("enter num4\n"); int num4 = input.nextInt(); System.out.print("enter num5\n"); int num5 = input.nextInt(); // you …

Member Avatar for peter_budo
0
1K
Member Avatar for sushil490023

What are you required to use? You can do this with simple println. Ok, you edited your post, It's useful to tell me that.

Member Avatar for sushil490023
0
83
Member Avatar for smoothe19
Member Avatar for Akill10
0
592
Member Avatar for StacyAnn1296
Member Avatar for acash229

[url]http://download.oracle.com/javase/1.4.2/docs/api/java/util/Timer.html[/url] This next link may be of more use [url]http://www.java-forums.org/new-java/13301-beginner-create-countup-timer.html[/url]

Member Avatar for acash229
0
308
Member Avatar for kumpul101

> // In this code example I assume that firstArray and secondArray are primitive array > // reference variables, and that and import java.util.Arrays; has been done. > if (Arrays.equals(firstArray, secondArray)) > System.out.println("The arrays are equal."); > else > System.out.println("The arrays are not equal."); Hmm, What exactly is that testing …

Member Avatar for kumpul101
0
191
Member Avatar for Jiblix

You cannot import inside a class. Move the import statement all the way to the top, above your class declaration. Import statements should not be incased in any code, declare them above your code at all times.

Member Avatar for Jiblix
0
232
Member Avatar for aguazul

We refer to ourselves as Computer Literate, not Computer Geeks!! :) Welcome!

Member Avatar for mackone
0
53
Member Avatar for eduard77

[CODE]int range(int lower, int higher, int sum=0) { while (lower <= higher) { //do something ++lower; } return sum; }[/CODE]

Member Avatar for eduard77
0
85
Member Avatar for blknmld69

At line 22, you have an opening brace that does nothing. Remove that and it should remove alot of those errors. You have: [CODE]# double getAverage() [b][U]{[/U] remove this[/b] // compute average test grade return (test1 + test2 + test3) / 3; [/CODE] Then obviously replace the { with a …

Member Avatar for Akill10
0
1K
Member Avatar for NV43
Member Avatar for aviavyne
Member Avatar for kenn1213

Maybe put it all in a do..while loop. This way, it will keep asking for input so you can press 1,2 etc multiple times. You will need an array or something similar to store the inputs though. Then at each case, it adds the food name to the array.

Member Avatar for Akill10
0
116
Member Avatar for blknmld69

//topClass.class [CODE][U]public[/U] topClass { class innerClass{//not public } class innerClass2{ } }[/CODE]

Member Avatar for NormR1
0
263
Member Avatar for Cheese Man 808

You can just a have print message after the loop to tell the user your message, since the only way to break out of the loop is for a number to be negative. And then to make it continue you can do something like this: [CODE] boolean bEscape = true; …

Member Avatar for tux4life
0
110
Member Avatar for Stefano Mtangoo
Member Avatar for PDB1982

Look at your invoice classes constructor. You are telling the program to set the Total to whatever the initialbalance is. [CODE]public Invoice( double initialBalance )//This means when you create a new //invoice object, it will need 1 argument of type double Invoice account1 = new Invoice(0.00);//You have initialBalance as 0, …

Member Avatar for tux4life
0
98
Member Avatar for hehe31

[QUOTE=hehe31;1331049]can i ask the formulas for integer arithmetic?? it's because i'm still new to programming...[/QUOTE] [url]http://en.wikipedia.org/wiki/Arithmetic[/url]

Member Avatar for hehe31
0
147
Member Avatar for churva_churva

I have no idea how you have put up with him this far javaAddict. He clearly does not want to learn and clearly did not write that code himself.

Member Avatar for javaAddict
0
269
Member Avatar for nix_xin

Well Its quite simple I believe, A char is a single character, that is a letter, a digit, a punctuation mark, a tab, a space or something similar. Therefore, if you want to find the ascii value of a number, you simple cast the number as a char. e.g. [CODE]System.out.print((char)+97); …

Member Avatar for Akill10
0
140
Member Avatar for peter brown

Why did you bump a thread from 2004? Create your own thread if you needed help.

Member Avatar for Akill10
1
1K
Member Avatar for kuchick32

You will need to accept an input from the user. Then simply compare that input for each grade. e.g. [CODE]if(input.equals("A")) { //..print the message for the A grade. } //etc... [/CODE]

Member Avatar for Akill10
0
129
Member Avatar for subrat_p

java -jar <MyJar.jar> ....(will only work for executable jar files. Not all jar files are executable) or if you still have a problem then it will most probably be a class path problem. If you still have a problem tell me.

Member Avatar for Ezzaral
0
175
Member Avatar for bino87

What is your problem? Can you compile? Do you get errors? If so, copy paste which errors you receive.

Member Avatar for robertmacedonia
0
373
Member Avatar for smoothe19

>> How do I make this code generate a new pro when the "NEXT" button is pushed by Sir Saula in Java (Dec 7th, 2009) Sorry my friend but that is not 2 weeks of Java. It would be appreciated if you refrained from believing we have ape brains. Like …

Member Avatar for javaAddict
-3
344
Member Avatar for blknmld69
Member Avatar for anuj6928
Member Avatar for coil
0
162

The End.