![]() |
|
#1
|
||||
|
||||
Convert the input into square yardsSince I was a bit vague the last time, here is my program which is suppossed to apply a discount based on square yards of carpet purchased at twenty dollars a square foot.The program is suppossed to convert the input into square yards and perform various operations. Will someone who knows what they are doing take a look at this and tell me what I am doing wrong? It would be greatly appreciated, PAY IT FORWARD!
JAVA Code:
I TRIED THIS PROGRAM ALSO JAVA Code:
Last edited by LuciWiz : 26-Sep-2005 at 02:24.
Reason: Fixed tags
|
||||
|
#2
|
||||
|
||||
Re: Convert the input into square yardshi pjpav,
You should make the following changes in your CarpetSale program: 1. You cannot use spaces(blank characters) in your variable names. You should use underscore(_) instead. so correct the corresponding variables by using _ instead of space. 2.You typed these at once you declared the variables. In java the variables are assigned to 0 default. so these code have no effect. You have to enter these code only after you know all the values of the variables to the right. JAVA Code:
3. You missed out a semicolon in numerous occasions. Please correct those errors. 4. You missed out a comma in the System.out.println statements. for example in line 115, JAVA Code:
ie your statement should be like this: JAVA Code:
5. You can never declare like this: JAVA Code:
JAVA Code:
6.You have initialized the measurement variable of type char in numerous occasions. it should be done only once. remove the extra JAVA Code:
7. You cannot use the measurement variables of type int and char at the same time. JAVA Code:
JAVA Code:
8. You have complicated the program very much. try to simplify your program. In your CarpetDiscount.java: 1.You didnt include the header files to use JOptionPane, getDouble() and getlnWord(). 2.You didnt declare many of your variables. bye, Paramesh. __________________
Don't walk in front of me, I may not follow. Don't walk behind me, I may not lead. Just walk beside me and be my friend. |
Recent GIDBlog
Install Adobe Flash - Without Administrator Rights by LocalTech
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| GradeBook Program | x3ro | C++ Forum | 19 | 03-Apr-2005 19:28 |
| Using files for input | crystalattice | C++ Forum | 15 | 31-Aug-2004 18:53 |
| [C] Discarding input | Alhazred | C Programming Language | 8 | 04-Aug-2004 11:45 |
| IP tables | rogermark100 | C Programming Language | 6 | 18-Apr-2004 07:22 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The