473,320 Members | 2,133 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Urgent Help needed

2
Ive been given this assignment before the half term and i have to hand it in by monday basically its a program it has 5 erros and i cant find them could any1 help me with this pelase

Expand|Select|Wrap|Line Numbers
  1. Public class AddThree  {
  2. import java.swing.JOptionPane;
  3. Public static void main (String args[ ]  )
  4. String firstNumber, secondNumber, thirdNumber
  5. int num1, num2, num3, sum, product;
  6. double average;
  7. firstNumber = JOptionPane.showInputDialog (Enter first Integer:);
  8. secondNumber  = JOptionPane.showInputDialog (Enter second Integer:" );
  9. thirdNumber  = JOptionPane.showInputDialog (Enter second Integer:  " );
  10. num1 = Integer.Parseint(firstNumber) ;
  11. num2 = Integer.Parseint(secondNumber) ;
  12. num3 = Integer.Parseint(thirdNumber) ;
  13. Product = num1 * num2 * num3;
  14. average = sum / 3;
  15. JOptionPane.showMessagedialog( null,"The Sum is " + Sum + "\nthe product is JOptionpane.INFORMATION_MESSAGE );
  16. system.exit(0);
  17. }
  18.  
  19. }
  20.  
Oct 27 '07 #1
5 992
JosAH
11,448 Expert 8TB
Those are all compilation errors; the compiler does its utmost best to tell you:

1) what line the error was found;
2) what symbol caused the error;
3) what was expected instead;
4) the exact column position of the error.

Read each compilation error one by one. Fix them one by one. You could even
fix the first compilation error, recompile and repeat the process until all compilation
errors are gone. I had a look at your code and most of the errors are simply typos,
wrong upper/lower case, misplaced double quotes, forgotten semi colons etc.

Just fix them and see if your program runs.

kind regards,

Jos
Oct 27 '07 #2
jaaz
2
Thanks for the help i know this sound really dumb but cant you tell me in what lines i have got errors? if you help me with that it would be much apprecfiated.
Oct 28 '07 #3
JosAH
11,448 Expert 8TB
Thanks for the help i know this sound really dumb but cant you tell me in what lines i have got errors? if you help me with that it would be much apprecfiated.
But your compiler told you that already, line by line. Here are the first errors:

1) 'public' has a lower case 'p', it's not 'Public'.
2) the 'import' line should be the first line in the source file.

You can do the rest yourself easily; just read what the compiler told you.

kind regards,

Jos
Oct 28 '07 #4
dav3
94
Expand|Select|Wrap|Line Numbers
  1. firstNumber = JOptionPane.showInputDialog (Enter first Integer:);
  2. secondNumber  = JOptionPane.showInputDialog (Enter second Integer:" );
  3. thirdNumber  = JOptionPane.showInputDialog (Enter second Integer:  " );

just look at the colors. Colors are an easy way to spot thing such as improper use of quotes:)
Oct 29 '07 #5
heat84
118 100+
check the case of your keywords and also all imports must be outside the class. Java is case sensitive remember.
Nov 12 '07 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: choksi | last post by:
Hello All I am running PHP5.0.2 over apache 1.3.29 and openssl-0.9.7d on a Debian Linux and with a fake (internal)ip. Php Configure command './configure' '--with-apxs=/www/bin/apxs'...
10
by: Tony Archer | last post by:
Gentlemen, your urgent help is needed in solving a STRANGE problem. I have two servers a dev box, and a production box. On the dev box everything works fine, in production it hoses: One of...
1
by: Tony Archer | last post by:
(Forgive the dupicate post, I had left out the OS Version out of the prior post.) Gentlemen, your urgent help is needed in solving a STRANGE problem. I have two servers a dev box, and a...
0
by: felix_william | last post by:
Attention=3A Dear friend=2C REQUEST FOR BUSINESS RELATIONSHIP OF GREAT PROFITS I am HON=2E =28DR=2E=29 Felix William=2C the Director of Procurement and Contract Award at the Nigerian National...
12
by: Vibhajha | last post by:
Hi friends, My sister is in great problem , she has this exam of C++ and she is stuck up with some questions, if friends like this group provides some help to her, she will be very grateful....
4
by: Random | last post by:
The way I've built my page is to take the user through a multi-form process, only rendering those controls that are needed for each section. The ViewState is working the way I want it to,...
7
by: meenasamy | last post by:
Hi all, i need to create a function that takes three parameters( Original currency, needed currency, amount) i need to convert from the original currency to the needed currency the amount and...
3
by: N. Spiker | last post by:
I am attempting to receive a single TCP packet with some text ending with carriage return and line feed characters. When the text is send and the packet has the urgent flag set, the text read from...
2
by: Preetam Pattanashetty | last post by:
Hi I am learning ASP.NET using C#. I am able to run .aspx files on local system, but when I load them to the server, I get the "Server Error in '/' Application" error. I have tried to configure the...
0
by: Christopher | last post by:
Urgent Help Needed: The EPVH-1.1 Visual Hull Library. Dear All, I am a student doing research in computer vision. The EPVH-1.1 Visual Hull Library will really help a lot in my research. I...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.