Question: IN JAVA: Write a program using nested IF statements. Your program will classify boxers into mens and womens weight classes. Begin by asking your user,

IN JAVA:

Write a program using nested IF statements. Your program will classify boxers into mens and womens weight classes. Begin by asking your user, in two separate questions (using the Scanner), their sex (Male or Female) and then weight (in pounds). Then, classify them into one of six categories (using nested-IFs), as seen in the table. Once classified, output a message to the user letting them know where they have been placed.

lightweight- Male: [0,170) Female: {0,130)

middleweight- Male: [170,220) Female: [130,185)

heavyweight- Male: [220, infinity) Female: [185, infinity)

NOTE: [170, 220) means that the class lowest weight is 170lbs and the highest weight is 219.999999999lbs. HINT: You should have an outer IF/ELSE statement for men and women. Each of the outer blocks should contain their own IF/ELSEIF/ELSE structures for weight class. Please enter your gender ("Male" or "Female"): Male Please enter your weight in pounds: 130 You have been placed in the men's lightweight class.

Thank you!

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!