Error in my Lab2A, Can you help?

//Scott Wheelock
//CSCI-111L-D02
//09-24-2002
//Oliver Wallock
//D02
//Lab 2A
//[email protected]
//Today we will write an application that inputs three integers from the user
//and displays the sum, average, product, smallest and largest of the numbers
//in an information message dialog box.
//Java extensions packages
import javax.swing.JOptionPane;     //Import class JOptionPane
public class Lab2A {
     //Main method begins execution of Java application.
     public static void main ( String args[] )
          String firstNumber;     //First string entered by user.
          String secondNumber;     //Second string entered by user.
          String thirdNumber;     //Third string entered by user.
          int number1;          //First number in funstion.
          int number2;          //Second number in funstion.
          int number3;          //Third number in funstion.
          int sum;          //Sum of number1, 2, & 3.
          int average;          //Average of number1,2,3.
          int product;          //Product of number1,2,3.
          //Read in first number from the user as a String.
          firstNumber =
               JOptionPane.showInputDialog ( "Enter first integer" );
          //Read in second number from the user as a String.
          secondNumber =
               JOptionPane.showInputDialog ( "Enter second integer" );
          //Read in third number from the user as a String.
          thirdNumber =
               JOptionPane.showInputDialog ( "Enter third integer" );
          //Convert numbers from type String to type int
          number1 = Integer.parseInt ( firstNumber );
          number2 = Integer.parseInt ( secondNumber );
          number3 = Integer.parseInt ( thirdNumber );
          //Sum the numbers.
          sum = number1 + number2 + number3;
          //Average the numbers.
          average = ( number1 + number2 + number3 )/3;
          //Multiply the numbers.
          product = number1 * number2 * number3;
          //Display the results.
          JOptionPane.showMessageDialog ( null, "The sum is " + sum, "The average is " + average,
"The product is " + product, "Results",
JOptionPane.INFORMATION_MESSAGE );
               System.exit ( 0 );     //Terminate application.
          }                    //Ends method main.
}                              //Ends class Lab2A.

The problem lies in the way you try to use showMessageDialog(). Check the specification more closely, and make sure your message is in a single string, the title in another single string and so on..
Regards,
Cyric

Similar Messages

  • I´m trying to open an excel file in numbers not being successful. The error msg is unexpectedly error using plugin SFCompatibility can you help me?

    I´m trying to open an excel file in numbers not being successful. The error msg is unexpectedly error using plugin SFCompatibility can you help me? Already changed the extension of the excel document to xlsx an now gives an unknown import error.

    In Excel have you tried saving directly to xls (not xlsx) and opening the xls in Numbers?
    If you have a complicated workbook in Excel that uses lots of Excel's advanced features, Numbers may not be able to handle the import.  It does pretty well on basic things, though.
    If you're just trying to get data into Numbers, then often copy-paste from Excel is easier than trying to open xls files.
    SG

  • Hi Guys, Im trying to send a 80pages IPhoto book to the store but the uploading fails, I tried several times and always a message "an error occurred" without clarification, can you help me?

    Hi Guys, Im trying to send a 80pages IPhoto book to the store but the uploading fails, I tried several times and always a message "an error occurred" without clarification, can you help me?
    Is there any size limit? or a limit of time to upload? (as it takes more than one hour!!!)

    Preview the book -
    Before ordering your book preview it using this method - http://support.apple.com/kb/HT1040 - and save the resulting PDF for reference - the delivered book will match it.
    if it is good boot into safe mode, preview again (only limited fonts are loaded in safe mode) and upload
    LN

  • HT5714 hi i have pre-ordered a song however when i try to download it, it says theres an error on my itunes. can you help?

    hi i have pre-ordered a song however when i try to download it, it says theres an error on my itunes. can you help?

    Hey elgriffiths,
    Thanks for the question. I understand you are having issues downloading your pre-ordered content. The resolution is going to depend on the error message you are receiving, however, I have included two articles that address a number of common errors:
    iTunes: Possible iTunes Store errors
    http://support.apple.com/kb/TS1424
    iTunes: Advanced iTunes Store troubleshooting
    http://support.apple.com/kb/TS3297
    Thanks,
    Matt M.

  • I have Adobe Acrobat Pro and it will not open my Photoshop CS4, error code 148.3 Can you help?

    I have Adobe Acrobat Pro and Windows Vista. I am unable to open my Photoshop CS4, error code 148.3. Can you help me resolve this problem?

    Hi,
    Please try the steps given in following article:
    http://helpx.adobe.com/creative-suite/kb/error-licensing-stopped-windows.html
    Regards,
    Anoop

  • I can not download Adobe reader. I am getting error message 1936. Can you help?

    I can not download Adobe reader. I am getting error 1936. Can you help?

    What is your operating system?  Is there anything else beside the number 1936?

  • HT204406 I have received an error message when i try to start iTunes Match, "We coulnd not complete your iTunes Store request.  An unknown error occurred (4001).  Can you help with this error?

    I subscribed to iTunes Match, but after the information is gathered about my iTunes library, i get an error message :  "We could not complete your iTunes Store request.  An unknown error occurred (4001).  Try again later." 
    Can you help fix this error?

    Yesterday I went to settings in my iPhone, Music, turned iTunes Match to "Off".  I then updated Match in iTunes and it worked!  I don't know why, but it worked.

  • HT201442 for my ipod 5g i can not downgrade ios 7.0.4 to ios 6.1.3 it was saying that  (a unknown error has occured {3194} ,,,,can you help me too downgarde//

    i want downgrade ios 7.0.4 to ios 6.1.3 it wsa saying that [error-3194] can you help me  too downgarde

    Thar is correct. Downgrading the iOS is not supported by Apple. If you try you will get the 3194 error.

  • Error with oil paint can you help

    I'm using Photoshop CS6 on a PC. When I tried to apply the oil pain filter, I got an error message saying "The filter you were using encountered an unknown graphics processor error that caused an unexpected exit. Check the manufacturer's website for the latest software." Could you let me know on how to fix this? Thank you!

    I believe what this is saying is you need to update your video card driver as it is not up to the job.  Go to makers website and download.
    You might also get some relief if you change the advanced graphics card preferences to Basic.  (edit/preferences/performance).
    Hope this helps.

  • Trying to download free photoshop and received error code 148:3 can you help

    Need help tying to download free photoshop and receiving error code 148:3

    Something is preventing the licensing from working. Make sure to run with sufficient user privileges and file permissions.
    Mylenium

  • I have an eook open on my pc(windows) and can't get it on my laptop.Error message is lic_already_fulfilled.Can you help

    I have an ebook open on my windows pc and would like to continue ir on my laptop. The error message is LIC_ALREADY_ FULFILLED..
    My laptop is authorized without an ID so I thought I'd be OK.Any thoughts?

    Just in case this comes up for anyone else... I got the windows BACK by hooking my computer up to the external monitor, and REVERSING the arrangement of the monitors (so the one that was on the left was on the right, and vice versa). This placed the window in my field of view and I was able to retrieve it.

  • I am getting a communicat from Java Script that: exc in ev handl Type Error: brw is undefined, Can you help me? Thank you. I don't know what to do.

    Exc in ev handl: TypeError: brw is undefined. Problem.

    Start Firefox in <u>[[Safe Mode]]</u> to check if one of the extensions or if hardware acceleration is causing the problem (switch to the DEFAULT theme: Firefox (Tools) > Add-ons > Appearance/Themes).
    *Don't make any changes on the Safe mode start window.
    *https://support.mozilla.com/kb/Safe+Mode
    *https://support.mozilla.com/kb/Troubleshooting+extensions+and+themes

  • I get an error coode 5506 when i try to link to my comp. can you help

    i have been try to link to my computer to down load music and  recive an error message 5506. Can  you help me?

    This forum is for questions from those managing sites on iTunes U, Apple's service for colleges and universities to post educational material in the iTunes Store. You'll be most likely to get help with this issue if you ask in the general iTunes for Windows forum.
    Regards.

  • Can you help me? I meet  errors when I do incomplete recovery with RMAN

    In recover step, There are following errors:
    RMAN-11001: Oracle Error: ORA-01547: warning: RECOVER succeeded but OPEN RESETLOGS would get error below
    ORA-01152: file 1 was not restored from a sufficiently old backup
    ORA-01110: data file 1: '/d/db/oradata/db01/system01.dbf'
    question:
    1. Should I restore archive log files generated on July 16th back to orignal archive directory in order to avoid to recover failure?
    2. Or Should I add the command "sql 'alter system archive log current'" in the backup script in order to avoid to recover failure?
    The following is the detail information:
    The database is ok when I try to do incomplete recovery database that was fully backed up on July,16th,2004. The database is oracle 8.1.7 and is in the archive mode:
    The following is the backup script:
    run {
    allocate channel 'dev_0' type 'sbt_tape'
    parms 'ENV=(OB2BARTYPE=Oracle8,OB2APPNAME=db01,OB2BARLIST=ora8i_online)';
    backup incremental level 0 filesperset 1
    format 'ora8i_online<db01_%s:%t:%p>.dbf'
    database
    include current controlfile
    archivelog all delete input;
    I use it to do a full backup on July 16th,17th successfully.
    And I use the following scripts to do incomplete recovery:
    run {
    allocate channel 'dev_0' type 'sbt_tape'
    parms 'ENV=(OB2BARTYPE=ORACLE8,OB2APPNAME=db01)';
    sql "alter database mount";
    set until time ='17.07.2004';
    restore database;
    recover database;
    sql "alter database open resetlogs";
    sql "alter database open";
    There script is successful in restore step. But there are some errors in recover step. The detail information is showing in following log:
    RMAN-03022: compiling command: allocate
    RMAN-03023: executing command: allocate
    RMAN-08030: allocated channel: dev_0
    RMAN-08500: channel dev_0: sid=13 devtype=SBT_TAPE
    RMAN-08526: channel dev_0: HP OpenView OmniBack II A.04.10/176
    RMAN-03022: compiling command: sql
    RMAN-06162: sql statement: alter database mount
    RMAN-03023: executing command: sql
    RMAN-03022: compiling command: set
    RMAN-03022: compiling command: restore
    RMAN-03022: compiling command: IRESTORE
    RMAN-03023: executing command: IRESTORE
    RMAN-08016: channel dev_0: starting datafile backupset restore
    RMAN-08502: set_count=2056 set_stamp=531622798 creation_time=16.07.2004
    RMAN-08089: channel dev_0: specifying datafile(s) to restore from backup set
    RMAN-08016: channel dev_0: starting datafile backupset restore
    RMAN-08502: set_count=2180 set_stamp=531623409 creation_time=16.07.2004
    RMAN-08089: channel dev_0: specifying datafile(s) to restore from backup set
    RMAN-08523: restoring datafile 00001 to /d/db/oradata/db01/system01.dbf
    RMAN-08023: channel dev_0: restored backup piece 1
    RMAN-08511: piece handle=netace_ora8i_online<db01_2180:531623409:1>.dbf tag=null params=NULL
    RMAN-08024: channel dev_0: restore complete
    RMAN-08023: channel dev_0: restored backup piece 1
    RMAN-08511: piece handle=netace_ora8i_online<db01_2212:531623994:1>.dbf tag=null params=NULL
    RMAN-08024: channel dev_0: restore complete
    RMAN-03022: compiling command: recover
    RMAN-03022: compiling command: recover(1)
    RMAN-03022: compiling command: recover(2)
    RMAN-03022: compiling command: recover(3)
    RMAN-03023: executing command: recover(3)
    RMAN-08054: starting media recovery
    RMAN-03022: compiling command: recover(4)
    RMAN-03026: error recovery releasing channel resources
    RMAN-11001: Oracle Error: ORA-01547: warning: RECOVER succeeded but OPEN RESETLOGS would get error below
    ORA-01152: file 1 was not restored from a sufficiently old backup
    ORA-01110: data file 1: '/d/db/oradata/db01/system01.dbf'
    RMAN-08031: released channel: dev_1
    RMAN-08031: released channel: dev_2
    RMAN-08031: released channel: dev_0
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-03002: failure during compilation of command
    RMAN-03013: command type: recover
    RMAN-03002: failure during compilation of command
    RMAN-03013: command type: recover(4)
    RMAN-06003: ORACLE error from target database: ORA-01220: file based sort illegal before database is open
    ORA-06512: at "SYS.X$DBMS_RCVMAN", line 7220
    ORA-06512: at "SYS.X$DBMS_RCVMAN", line 5053
    ORA-06512: at line 1
    I repeat my questions:
    1. Should I restore archive log files generated on July 16th back to original archive directory in order to avoid to recover failure?
    2. Or Should I add the command "sql 'alter system archive log current'" in the backup script in order to avoid to recover failure?
    Can you help me ? Thank you.

    which o.s u are using i can't help you as i never worked on ver 8i,i can tell you incomplete recovery on oracle 9i on win 2000 server.
    thanks : alok kumar

  • Can you help me? I meet some errors when I do incomplete recovery with RMAN

    In recover step, There are following errors:
    RMAN-11001: Oracle Error: ORA-01547: warning: RECOVER succeeded but OPEN RESETLOGS would get error below
    ORA-01152: file 1 was not restored from a sufficiently old backup
    ORA-01110: data file 1: '/d/db/oradata/db01/system01.dbf'
    question:
    1. Should I restore archive log files generated on July 16th back to orignal archive directory in order to avoid to recover failure?
    2. Or Should I add the command "sql 'alter system archive log current'" in the backup script in order to avoid to recover failure?
    The following is the detail information:
    The database is ok when I try to do incomplete recovery database that was fully backed up on July,16th,2004. The database is oracle 8.1.7 and is in the archive mode:
    The following is the backup script:
    run {
    allocate channel 'dev_0' type 'sbt_tape'
    parms 'ENV=(OB2BARTYPE=Oracle8,OB2APPNAME=db01,OB2BARLIST=ora8i_online)';
    backup incremental level 0 filesperset 1
    format 'ora8i_online&lt;db01_%s:%t:%p&gt;.dbf'
    database
    include current controlfile
    archivelog all delete input;
    I use it to do a full backup on July 16th,17th successfully.
    And I use the following scripts to do incomplete recovery:
    run {
    allocate channel 'dev_0' type 'sbt_tape'
    parms 'ENV=(OB2BARTYPE=ORACLE8,OB2APPNAME=db01)';
    sql "alter database mount";
    set until time ='17.07.2004';
    restore database;
    recover database;
    sql "alter database open resetlogs";
    sql "alter database open";
    There script is successful in restore step. But there are some errors in recover step. The detail information is showing in following log:
    RMAN-03022: compiling command: allocate
    RMAN-03023: executing command: allocate
    RMAN-08030: allocated channel: dev_0
    RMAN-08500: channel dev_0: sid=13 devtype=SBT_TAPE
    RMAN-08526: channel dev_0: HP OpenView OmniBack II A.04.10/176
    RMAN-03022: compiling command: sql
    RMAN-06162: sql statement: alter database mount
    RMAN-03023: executing command: sql
    RMAN-03022: compiling command: set
    RMAN-03022: compiling command: restore
    RMAN-03022: compiling command: IRESTORE
    RMAN-03023: executing command: IRESTORE
    RMAN-08016: channel dev_0: starting datafile backupset restore
    RMAN-08502: set_count=2056 set_stamp=531622798 creation_time=16.07.2004
    RMAN-08089: channel dev_0: specifying datafile(s) to restore from backup set
    RMAN-08016: channel dev_0: starting datafile backupset restore
    RMAN-08502: set_count=2180 set_stamp=531623409 creation_time=16.07.2004
    RMAN-08089: channel dev_0: specifying datafile(s) to restore from backup set
    RMAN-08523: restoring datafile 00001 to /d/db/oradata/db01/system01.dbf
    RMAN-08023: channel dev_0: restored backup piece 1
    RMAN-08511: piece handle=netace_ora8i_online&lt;db01_2180:531623409:1&gt;.dbf tag=null params=NULL
    RMAN-08024: channel dev_0: restore complete
    RMAN-08023: channel dev_0: restored backup piece 1
    RMAN-08511: piece handle=netace_ora8i_online&lt;db01_2212:531623994:1&gt;.dbf tag=null params=NULL
    RMAN-08024: channel dev_0: restore complete
    RMAN-03022: compiling command: recover
    RMAN-03022: compiling command: recover(1)
    RMAN-03022: compiling command: recover(2)
    RMAN-03022: compiling command: recover(3)
    RMAN-03023: executing command: recover(3)
    RMAN-08054: starting media recovery
    RMAN-03022: compiling command: recover(4)
    RMAN-03026: error recovery releasing channel resources
    RMAN-11001: Oracle Error: ORA-01547: warning: RECOVER succeeded but OPEN RESETLOGS would get error below
    ORA-01152: file 1 was not restored from a sufficiently old backup
    ORA-01110: data file 1: '/d/db/oradata/db01/system01.dbf'
    RMAN-08031: released channel: dev_1
    RMAN-08031: released channel: dev_2
    RMAN-08031: released channel: dev_0
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-03002: failure during compilation of command
    RMAN-03013: command type: recover
    RMAN-03002: failure during compilation of command
    RMAN-03013: command type: recover(4)
    RMAN-06003: ORACLE error from target database: ORA-01220: file based sort illegal before database is open
    ORA-06512: at "SYS.X$DBMS_RCVMAN", line 7220
    ORA-06512: at "SYS.X$DBMS_RCVMAN", line 5053
    ORA-06512: at line 1
    I repeat my questions:
    1. Should I restore archive log files generated on July 16th back to original archive directory in order to avoid to recover failure?
    2. Or Should I add the command "sql 'alter system archive log current'" in the backup script in order to avoid to recover failure?
    Can you help me ? Thank you.

    You are correct. In RMAN8i, you should add the "alter system archive log current; command before you backup the archive logs.
    You are running into the case where Oracle needs additional redo to make the database consistent that was located in the current online log at the time of the backup.
    If you set UNTIL TIME to an earlier time does the recover work?
    In Oracle9i, if you issue the command, "backup database plus archive logs", RMAN will automatically archive the current online log before performing the archive log backups.
    Thanks, Tammy

Maybe you are looking for

  • SD process cycle

    Hi    Can any one provide me with process life cycle of SD .please forward me the documents on [email protected] Thanks and Regards Naval

  • Profit Analysis field grayed out

    Hello All, I am trying to configure the "Activate Project Management in Controlling area" in PS. When I am trying to activate the components, the Profit Analysis field is grayed out. Since we are implementing COPA at our current client, I assume that

  • ESCON to FICON bridge?

    I have a client that uses a very old mainframe that can only take ESCON.  Obviously I would like to use a modern director storage platform, and I am looking for a device that can bridge ESCON to FICON.  Has anyone heard of such a thing? Recommendatio

  • SCCM Distribution Point Failures

    I have 16 DP's in Config manager all were working last week. Now only 2 are allowing content. The error message states: Possible cause: Distribution Manager does not have sufficient rights to the computer. Solution: Verify that the site server comput

  • Lenovo X1 Carbon Mute Button - Win 7

    Hi All My x1 Carbon came with Windows 8 pre-installed; however, I found it horrible and such I reinstalled Windows 7 64Bit (Personal Copy). After spending hours trying to download all the drives, I downloaded system update and it seemed to install 10