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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started