Requiring Assistance

/* Session6B07.java */
/* Evaluates compatibility for a dating agency */
import java.util.*;
public class Session6B07
  public static void main(String[] args)
  /* Description  ......
     Prompt for and read both ages
     IF both ages are valid
        Display valid message
        IF female is the eldest
           Compatibility is 1
        ELSE IF male is the eldest
          Compatibility is 2
        ELSE (same age)
           Compatibility is 3
        Display the compatibility
     ELSE (invalid ages)
        Display invalid message
/* variables for male age, female age & compatibility */
     int male_age,
          female_age;
     Scanner data_input = new Scanner(System.in);
      System.out.printf("Enter male age and then female age: ");
      male_age = data_input.nextInt();
      female_age = data_input.nextInt();
      if (male_age >= 18 && male_age <= 65) && (female_age >= 18 && female_age <= 65)
            System.out.printf ("Ages are valid%n");
             if (female_age >= male_age)
                 System.out.printf("Compatibility is 1");
                 else if (male_age >= female_age)
                     System.out.printf("Compatibility is 2");
             else (male_age == female_age)
                 System.out.printf("Compatibility is 3");
     else
            System.out.printf("Ages are invalid%n");
}When compiling I receive the following errors:
M:\>javac Session6B07.java
Session6B07.java:33: illegal start of expression
         if (male_age >= 18 && male_age <= 65) && (female
e <= 65)
                                               ^
Session6B07.java:33: ';' expected
         if (male_age >= 18 && male_age <= 65) && (female
e <= 65)
        ^
Session6B07.java:42: not a statement
                   else (male_age == female_age)
                        ^
Session6B07.java:45: 'else' without 'if'
     else
     ^
Session6B07.java:46: <identifier> expected
               System.out.printf("Ages are invalid%n");
                                ^
Session6B07.java:46: illegal start of type
               System.out.printf("Ages are invalid%n");
                                 ^
Session6B07.java:51: class, interface, or enum expected
^
7 errorsI would appreciate any help, thanks in advance.

Following dnb's advice all the errors have been removed, but the program doesn't function how it should do, which is quite odd.
Here's an update:
/* Session6B07.java */
/* Evaluates compatibility for a dating agency */
import java.util.*;
public class Session6B07
  public static void main(String[] args)
  /* Description  ......
     Prompt for and read both ages
     IF both ages are valid
        Display valid message
        IF female is the eldest
           Compatibility is 1
        ELSE IF male is the eldest
          Compatibility is 2
        ELSE (same age)
           Compatibility is 3
        Display the compatibility
     ELSE (invalid ages)
        Display invalid message
/* variables for male age, female age & compatibility */
     int male_age,
          female_age;
     Scanner data_input = new Scanner(System.in);
      System.out.printf("Enter male age and then female age: ");
      male_age = data_input.nextInt();
      female_age = data_input.nextInt();
      if ((male_age >= 18 && male_age <= 65) && (female_age >= 18 && female_age <= 65))
            System.out.printf ("Ages are valid%n");
             if (female_age >= male_age)
                 System.out.printf("Compatibility is 1");
                 else if (male_age >= female_age)
                     System.out.printf("Compatibility is 2");
                 else if (male_age == female_age)
                 System.out.printf("Compatibility is 3");
     else
            System.out.printf("Ages are invalid%n");
}

Similar Messages

  • Require assistance resolving error code 2331

    require assistance downloading reader

    Hi there Pat,
    Thanks for your contact.
    Operating system: Wndows 8 Pro
    Browser: Google Chrome
    Update for Adobe Reader XI (11.0.02)
    Update failed
    Error 2331. Error loading library MSPATCHA or finding entry point.Apply PatchToFileByHandlesEx.
    Fyi I cannot update Windows Defender Virus & Spyware definitions and get error code 0x80080005.I realize this is not your concern and have contacted Microsoft.
    I ran a full scan with Malwarebytes yesterday - nothing found.
    I hope you can resolve this for me so I may update Adobe.
    Kind regards,
    Geoff Nebel
    [private data removed]

  • I updates my iPad with the latest iOS and despite backing up all the information prior, my iBooks application was deleted along with a hundred important PDFs on it. Is it possible to locate these missing files? Urgently requires assistance. Thank you!

    I updated my iPad with the latest iOS and despite backing up all the information prior via iTunes, my iBooks application was deleted along with a hundred important PDFs on it. Is it possible to locate these missing files? Urgently require assistance. Thank you!

    Hi Sam,
    I understand where you are about being your own IT department, it can be overwhelming ...
    What drives to buy depends an awful lot on how you will use them, what your budget is, and your preferences.
    In the case of your DP Powermac, for online storage used primarily for editing, I would add one or more internal drives first. Look for drives that are at least 7200rpm and have at least an 8MB cache. 10,000rpm/16MB cache is even better, but more expensive. Seagate Barracudas have always been good choices.
    For backup purposes, I'd pick some good external FireWire drives; you can also use these for online editing, lots of people do. Your Mac has both FW400 and FW800 ports - either kind is fine but if you get drives that support both, you would want to connect them to the FW800 port for the added performance.
    In my experience, the Lacie d2 Extreme drives have been very very good. In fact I have 3 of them daisy-chained off my iMac G5 right now and they work flawlessly with FCE. Weibetech and Granite Digital drives are further upscale in performance and price. RAID configurations would be even further upscale. Do stay away from consumer level hard drives, however ... the Western Digital MyBook series & no-name drives come to mind ...
    Don't use a FireWire hub for your external drives, it's just asking for trouble.
    ps. And thanks for your nice comment about me. I'm happy to help, as are other folk in the forum.

  • After updating mavericks highlights the battery requires assistance

    after updating mavericks highlights the battery requires assistance

    "Service Battery" notification?
    You have to take the computer to the Apple store to have it checked out.
    You can try resetting SMC.
        Reset SMC.     http://support.apple.com/kb/HT3964
        Choose the method for:
        "Resetting SMC on portables with a battery you should not remove on your own".

  • Require assistance and suggestion on Report in Oracle APEX 3.2

    Hi all,
    Thanks in advance
    We have made Tabular report form based on table . Requirement is to have % in front of data
    View_cal
    =====
    2.0 %
    We tried to modified the query by concatenating but when we are trying to update the column name we are getting error . Is there any other way around So that we can implement
    Cheers
    Sachin

    hi,
    i think you want something like this:
    http://dbaforums.org/oracle/index.php?showtopic=8657
    regards,
    jR

  • Require assistance in rectification of Stock master data

    We entered the wrong prices of the opening Stock Finished goods now we need to rectify.
    Instead of entering the cost prices of the Finished goods we entered the sales prices of finished goods hence to get the proper profit and loss we need to rectify the opeing prices , we have also tarted the GRR pls assist

    Hi
    This can be done in data manager of MDM.
    You need to go to record mode.Non-lookup text and numeric fields[as in your case it is price] require typed/manual input and utilize the standard Windows edit control for data entry.
    To edit a non-lookup text or numeric field type a new value, or press Enter to open the cell and edit or overwrite the current value then press Enter to close the cell.
    According to data type you need to define the strategy and lucid explaination about the whole procedure you can find at
    <a href="http://help.sap.com/saphelp_mdm550/helpdata/en/43/7c378160f46fc9e10000000a1553f6/content.htm">this URL</a>
    Hope it will help you.
    regards,
    Krutarth

  • POTENTIAL BOOTCAMP USER REQUIRES ASSISTANCE PLEASE

    Hi All
    Thanks in advance for any answers to the following please
    I am considering using bootcamp by installing a windows disc version of vista that i had on my now defunct dell inspiron 1721 laptop to use for the occasional use of windows only games
    My questions being
    1) Will the dell disc work on my imac? and if it doesnt what are the potential pitfalls of trying such an installation
    2) Will i be able to also install a version of windows enterprise blue version 2007 that i also obtained for using on the above machine also?
    3) Is it possible to buy an external hard drive and attempt the installation on that rather than directly onto the imac
    apologies for being so cautious but having a trouble free imac for the last six months or so has been the best purchase i have ever made after almost ten years of windows nightmares!! and therefore would not want to put my mac at major risk for the sake of playing a few games via bootcamp and using the odd word document

    Generally speaking it is wrong to use any Windows disk that was not purchased specifically for your Mac. I've seen warnings posted here over the years against using a Dell (or other same type) disk and I've also seen people post success. Try the search function. From my own knowledge, if you launch Boot Camp Assistant and follow the BC install directions with precision then you cannot possibly hurt your Mac installation. This is assuming of course that you don't lose the ability to boot to OSX in the first place - a very rare problem. Keep a Time Machine or other duplicate of your OSX install just in case. Anyway - if your Windows install fails, you simply boot to OSX, launch Boot Camp, erase the partition (Restore Disk To A Single Volume) and you are good as new. Beware, though, there are current unaddressed issues in BC regarding the downloading of MS install drivers that are only well-explained on this message board. You should read these boards thoroughly to understand them since Apple has not issued a fix yet (AFAIK). The short version is that when BC Assistant asks you to download a file to burn a CD, lie and say you have already done so. Then use your Apple OSX install DVD after your Windows install is ready for Apple drivers. For my own Windows install I purchased the OEM low-cost (no support) Vista disk. If you browse around on line regarding OEM useage, it is a bit a user-agreement gray zone leaning towards the vendor and purchaser seemingly in the clear (provided they stick to the OEM rules) (Just my own personal current ever-evolving understanding of things). OEM might be the better option - who knows if MS will officially activate your Dell install after all that work? Just sayin...
    Message was edited by: NA Smith

  • Required Assistance

    hi there
    i am in the process of considering buying an Xserve Raid for my small business, however, after checking with the authorized dealer in hong kong that they told me to go for an IBM server instead since one of my program was written on TOMCAT which according to them Xserve does not support such.
    I rang the Apple team in the States and they said Xserve should be able to support TOMCAT, could anyone help me with this and to determine whether Xserve Raid supports the following:
    TOMCAT 5.0
    APACHI 2.0
    MySQL 5.0
    The authorized dealer in hong kong gave me a quotation on the following, which i suspect is not anything to do with Xserve:
    Apple MacPro Two Dual-Core 2.66 GHz Intel Xeon Two 2.66GHz Dual-Core Intel Xeon
    4GB (4x1 GB)
    500GB Serial ATA 3GB/s drive - 7200rpm (RAID 5)
    500GB Serial ATA 3GB/s drive - 7200rpm (RAID 5)
    500GB Serial ATA 3GB/s drive - 7200rpm (RAID 5)
    NVIDIA GeForce 7300 GT 256MB SDRAM
    1 x SuperDrive
    Apple keyboard & Mighty Mouse
    Apple 1 year warranty
    Mac OS X Server v10.4 (10-client license)
    AppleCare Protection Plan for MacPRo/Power Mac (w/ or w/o display) 3 years hardware warranty
    UPS: APC SMART-UPS 1000 230 V, (RS-232 interface +
    USB) w USB Cable, BLACK
    DANTZ REtrospect Workgroup backup 6.X w/20 clients
    External Data backup HDD: Lacie 500GB Ethernet Disk Mini
    Gigabit / USB 2.0/7200rpm / 16MB
    Please advise if non of the us in the office is a technical person, would it be worthwhile to go forward using an Xserve or is it easy to install, configure and maintain.
    Many thanks for your assistance in advance.
    MacBook Pro 17 inch   Mac OS X (10.4.9)   iMac, G4 PowerBook 15 inch, eMac, etc

    Ooops,
    I hope you don't mind me saying this, but it sounds to me like you really need to take a step back and get some information before you move forward.
    Facts:
    -The Xserve RAID is a large scale storage device. It doesn't "run" anything. It has no operating system, processor or anything like that. (You can think of it as really really big hard drive on the simplest level.)
    http://www.apple.com/xserve/raid/
    -Xserve is Apple's 1U high server computer running OS X Server.
    http://www.apple.com/xserve/
    -The MacPro is Apple's tower computer.
    http://www.apple.com/macpro/
    -Either the Mac Pro or the Xserve can connect to an Xserve RAID with the right card installed.
    -Tomcat, Apache, MySQL are software packages that need to run on a server or at least some kind of computer. OS X will support all of the packages - some of them come pre-installed. (OS X may or may not support Tomcat version 6 at this point I haven't kept up, but unless you NEED the latest servlet version 5 is fine.)
    Opinion:
    -If you are considering a large computer/server purchase I would be sure of what you are doing before committing.
    -The Apple quote you got is for a MacPro Tower which is a good computer, but whatever computer you're using you'll want to run OS X SERVER not just OS X for any serious Apache/Tomcat work.
    -The Xserve is designed for 24/7 server work and is 1U high and designed to go into server room racks. This is a good choice for remote server deployment.
    -You should hire - or at least pay as a consultant - someone who you trust to advise you on a purchase plan and put together a plan before you start spending a bunch of money.
    Hope that helps some,
    =Tod
    G5/2.0x2, Dual XServes x2, XRAID, beige G3 501Mhz    

  • Require assistance

    hello everybody,
    I have created my website and uploaded it ,I can browse it
    easily in Internet explorer but when I am trying to browse it in
    Opera i am unable to do so??? i.e. I am getting problem while
    browsing it in Opera.
    Problem are following:
    1. when i open a new page of my site it's content are not
    jastified properly.
    2. site navigations are created in flash. But when i open a
    new page, navigations are working but when i scroll down the page
    and then again scroll up that page, page navigations are not
    working. all navigations are SWF files. If i press refresh button
    it's working.
    My questions:
    1. How can i align the content of a page?
    2. If ther is any flash actionscript to slove this problem
    for SWf files?
    Kindly assist me in this matter....Urgent!
    Regards,
    Chandrani
    Problem are following:

    Hi Peter,
    Script works well and Good. But i cannot export the same in a CSV File. I used the below commands. But the output csv file is empty. I can just view the data in the monitor in the powershell window.
    Any idea how can i export this in CSV ?
    (get-mailboxdatabase) | foreach-object {write-host $_.Server, $_.name (get-mailbox -resultsize
    unlimited -database $_.name).count, $_.masterserveroravailabilitygroup} | Export-csv -Path C:\Rpt.csv
    And
    (get-mailboxdatabase) | foreach-object {write-host $_.Server, $_.name (get-mailbox -resultsize
    unlimited -database $_.name).count, $_.masterserveroravailabilitygroup} >C:\Rpt.csv
    Gautam.75801

  • Require assistance on recovery disk....

    Hi There 
    I bought an HP Mini 110-3610tu PC last month. Last night when i was trying to do a disk partition , due to low battery the system got switched off and now while restarting it again , it is showing me an error. My notebooks details would be mentioned below
    Product Model: LN397PA Product Name: HP Mini 110-3610tu PC
    Product Serial Number: [Personal Information Removed]
    Operating system installed is Windows 7 64-bit. 
    I had an word with the Executive in your HP Showroom in District Center. She  has asked me to get an recovery disk from the support. I tried calling on the care number but could not reach the assigned person. 
    I would request you to send me the recovery disk on my below mentioned address which would be my current address of residence. It would be
    [Personal Information Removed]
    You can also reach me on my no [Personal Information Removed] if you require any further updates. If i am posying it on wrong foroum , please passit on to the concerned person and get this resloved as soon as possible. 
    Expecting a quick reversal
    With Regards
    Ajay

    This is a peer to peer forum and members over here help each other voluntarily . Please refer below link in order to Contact HP
    http://www8.hp.com/us/en/hp-information/summary/ww​-contact-us.html
    //Click on Kudos and Accept as Solution if my reply was helpful and answered your question//
    I am an HP employee!!

  • I require assistance w/r/t nullpointerexception!

    Hi there, thanks for taking the time to read this. I'm a beginning Java programming student and I've unfortunately reached an impasse on a program given my level of knowledge. I've spent the last couple of hours attempting to diagnose this problem, so I will now try to articulate it rather than spewing tons of code (I assume this method is more helpful?)
    I am creating a program in which a Course object has, as a private data field, an array of Student objects. Once outside of the constructor which allocates the 10 student objects to the reference variable (studentlist), I find it impossible to accomplish anything when I try to reference a particular student object within the array of student objects within the course object.
    I am particularly interested in setting a specific student object within the array of students (i.e. studentlist[something]) to "point" to a specific student object that a separate method retrieved.
    Essentially, this is my problem:
    I am attempting to access an element of the array of student objects (a data field within my Course class), which has already been allocated via constructor, inside a behavior method of the Course class itself.
    A simple statement within the particular method of the Course class such as: "studentlist[0] = new Student()'" and also "studentlist[numofstudents] = student;" (student being the retrieved object reference variable, accounted for in terms of possessing desired info) gives me the evil NullPointerException. I'm simply at a loss and quite frustrated, so any advice will be of help. Thank you!

    A simple statement within the particular method of the Course class such
    as: "studentlist[0] = new Student()'" and also "studentlist[numofstudents] = student;"
    (student being the retrieved object reference variable, accounted for in terms of
    possessing desired info) gives me the evil NullPointerException.Be careful that in your Course constructor you don't declare and initialise another array. This will leave the instance variable still null.class Course {
            // the array in question
        private Student[] studentlist;
        Course() {
                // good
            studentlist = new Student[10];
                // bad - this new variable will "go out of scope"
                // when the constructor has finished
            //Student[] studentlist = new Student[10];
        // methods involving studentlist...
    }This is just a guess of course. For a more certain answer you will have to post some code! The trick is to leave out the code that doesn't have a direct bearing on your problem - but still include enough to show what the problem is.
    (A little point: studentlist[numofstudents] suffers from another problem if numofstudents has its obvious meaning. Java arrays are zero based, so the largest valid index is numofstudents-1.)
    Edited by: pbrockway2 on Nov 11, 2007 2:48 PM

  • Require assistance in choosing an email provider

    Hello
    I have never had my own email account, I do however have one provided by work but it has only been needed internally and there hasn't been an instance where I have needed to access my work email outside of work. I recently bought myself an iphone and ipad and it seems that I need to create an apple id which needs an email address. I can't use my work email for anything person so I need to create one so I can use them.
    The dilemma is my kids, aged 16, 21, 25, 26 and 29 who love their gadgets use google email on their iphones and ipads but my brother is somewhat of a techwiz in our family and reckons that I should avoid google with no real explanation of why.
    Although I have never needed my own email account, my friends and family have always been nagging me to get one so they can send me pictures and stuff so I guess it would be nice to have my own rather than have people send stuff to my kids. I even had to use my daughters credentials to get on to this forum.
    Which provider should I use? Emails seems to be a big commitment. I have read that google syncronises with instant email, calendars and contacts so I don't lose them if I lose my device but what's wrong with them? Are there better services out there? Preferably free? Coincidentally, most of my friends and family who have iphones have google email.
    Please help so I can start using these devices

    hi Nicola,
    Choosing email services is really a personal choice at the end.  Some will like one or reject one for many reasons and often, it's simply because they are using it for long time.
    If I may suggest however, is that you should try iCloud.com since Apple services are higly integrated with all of your devices functions.  I mean iCloud is giving you not only email, but iMessage, sync with contact, calendar, locating your phone, etc.  With your iPhone, you'll probably ending up using at least a few feature from iCloud.
    Given said this, you can anytime add as many email account you want on your iPhone since it allow to have an unified mailbox for any account.  At this point, the best thing would be to make sure your AppleID will be the same as the iCloud email as it will simplify your Apple account.

  • Require assistance in Interactive Report based in APEX 3.2

    Hi All,
    Thanks in advance
    I have created editable Interactive report based on Form with report .
    once report created , I have modified query with the column named TempNetto ,Temp Brutto .. Below is the query
    select "IDSUB",
    "JAHR",
    "IDMITARBEITERLISTE",
    "EKPREIS",
    "WEBUCHUNGEN",
    (WEBuchungen*EKPreis) TempNetto , --modified
    "NETTO",
    DECODE((WEBuchungen*EKPreis),0,0,(Netto+(Netto*VerwaltungskostenZuschlag)+(WEBuchungen*InfrastrukturkostenZuschlag))) TempBrutto, --modified
    "BRUTTO"
    from "#OWNER#"."SUBS"
    I receieved the below message "You have requested to change the Interactive Report query. If you added columns to the query, they will not be displayed when the report is run. You will need to use the actions menu and either select the columns or click Reset. If you removed any columns from the query, it will disable existing filters, highlight rules, and other report settings referencing those columns. Please confirm your request. "
    I want the column started with temp should appear in report . I have checked under search bar Action menu is checked and options like Select column and Reset is checked
    Kindly provide some help
    Cheers
    Sachin

    Hi,
    When you've selected all the columns (Select Columns) you then need to save the report...not reset it. Go back and make sure all columns are on the right and then:
    - Save Report
    - As Default Report Settings
    - Apply
    Mike

  • I require assistance. Phone calls unreturned, emails unanswered.

    Future help,
    In the year of 2009, I received PCS (Permanent Chance of Station) orders to Okinawa, Japan. I had, approximately 9 months or so before this, signed a two year contract with Alltel. (As you may know, Verizon bought Alltel.) I promptly took a copy of my orders to the place of origin where I had initiated my two year contract, and I was told it would be no problem- Service would terminate approximately on the 7th of January, 2010. My departure date was to be 1 January, 2010. Fast forward to August of 2010, I recieved a letter stating I was behind on several payments. Shocked, I called, emailed, and even at one point wrote Verizon Wireless, to no avail. Fast forward again, 5 TDY, and a lengthy deployment later, I'm very close to returning to the United States. Now, I really want to continue service with Verizon, but I refuse to pay for months of service that were agreed to be terminated. I still have the name and location of the original Verizon employee that supposedly "canceled" my contract. Please, I need a Verizon rep to get in touch with me, and help me figure this out.
    Sincerely,
    iN1nja

    Adam, I can't message you direct because you're not a "follower" or "friend". Please email me direct >Personal email address deleted. To the poster, request to follow Adam and he will accept and then you can communicate via Direct Messaging<
    Message was edited by: Verizon Moderator

  • Required assistance in ALV filter

    Hi Experts,
    I am not very good in ALV's I have an issue with REUSE_ALV_GRID_DISPLAY function module.The issue is on the initial output if I select the 1st field BOM Header and click on filter it is working fine.I am getting a selection screen and if I press F4 on select -low I am getting the values.But if I choose another field Recepie do the same exercise I could see only 00000 when I clicked on F4 for the selection screen.For information the BOM Header is char30 and Receipe is N 30 .In the below code I am unable to understand the purpose of passing i_default,I_save and I_variant.Can some tell me the root cause for this issue.Thanks in advance.
    Call ALV grid display.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          i_callback_program = sy-repid
          is_layout          = i_layout
          it_fieldcat        = g_fieldcat[]
          it_sort            = gi_sort[]
          i_default          = 'X'
          i_save             = 'A'
          is_variant         = i_variant
        TABLES
          t_outtab           = i_final_list
        EXCEPTIONS
          program_error      = 1
          OTHERS             = 2.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.

    hi,
    The fields I_default, I_Save and IS_variant are used for variant purpose.
    I guess no relation with the fields and the issue that you are facing  now.

Maybe you are looking for

  • ORA-02068 and ORA-03113

    Error 2068 trapped in 2PC on transaction 3.6.12908. Cleaning up. Error stack returned to user: ORA-02068: fatal error has occurred in Instance_name.WORLD. End-of-file has been detected in the communication channel: ORA-03113 Can anyone please share w

  • Unable to CIF Materials with Classification View

    Hi, We sent materials from R/3 (4.6C) to SCM 4.1.The materials without classifcation view went through successfully. But the materials with classifiation views failed. I have selected the materials,plant,class.characteristics. The organizational indi

  • N73 displays answer phone icon even though i have ...

    N73 displays answer phone icon even though i have no message. Any ideas? Its not who i am underneath. But what i do that defines me. You are here for a reason Superman. "Come to me son of Jor-EL. KNEEL BEFORE ZOD"

  • Setting up auditing for tables

    Hi Gurus, Could some one help me in setting up an auditing process for few tables on one of the schema say scott. auditing on insert,update,select and delete . I have 4 tables say for example emp, dept,org,ssn

  • Network Configuration Questions

    House is fairly large and wired for cat5 with cable modem in the basement. Linksys router there to 3 Airport Extreme n. (One in middle and one on each end) currently set up as 3 distinct networks (different names). In the middle of the house I can co