Question
Possible treatments vary from medication and ultraviolet light baths to hospitalization based on gender and several other factors. You must write a computer program that
Possible treatments vary from medication and ultraviolet light baths to hospitalization based on gender and several other factors. You must write a computer program that evaluates citizen responses from interview questions, determines the Biximent Metabolic Index (BMI), and recommends an appropriate treatment based on the value of BMI. The Biximent Metabolic Index (BMI) value can be estimated very accurately by using the newly revised Smithfield formula: BMI = 2.56 Age + (BL 467)/Weight GF Where: BMI is the Biximent Metabolic Index (BMI) Weight = weight in kilograms BL = Biximent Level Age = Age in solar cycles GF = Gender Factor Gender factors for each gender type are as follows: Gender Identification Gender Factor R or r 8.46 S or s 4.23 T or t 6.35
A comprehensive battery of tests has been administered to all citizens. These tests reliably determine the level of Biximent that is present in the circulatory system of each inhabitant. Weights are reported in kilograms and inhabitants report their age as a specific number of solar cycles. This table shows the severity and which treatment should be recommended based on the value of the Biximent Metabolic Index (BMI) value. Range of BMI Values Recommended Treatment Less than 80 Mild case, no treatment required 80 or greater, but less than 120 Serious case, Medication treatment 120 or greater, but less than 200 Acute case, Ultraviolet treatment 200 or greater, but less than 360 Severe case, Replacement therapy 360 or greater Extreme case, Hospitalization It is important to note that if the Biximent Metabolic Index (BMI) value is greater than 200.00, inhabitants are considered Highly Contagious, and an additional line of output is required in your recommendation report. Your program should do the following: 1. Prompt the citizen for their weight in kilograms. 2. Prompt the citizen for their age in solar cycles. 3. Prompt the citizen for their gender identification (R, S, or T) 4. Prompt the citizen for their Biximent level. 5. Calculate the Biximent Metabolic Index (BMI) 6. Display the recommended treatment for that level of BMI in a nicely formatted, comprehensive report that: Echoes the input parameters: weight, age, gender identification, and Biximent level. Displays the Biximent Metabolic Index (BMI) level to 2 decimal places. Recommends treatment appropriate to the BMI level. Identifies a Highly Contagious condition, if appropriate. Lower-case letters (r, s, and t) are sometimes used by the clans that inhabit the northern hemisphere of the planet to indicate their gender. These letters should be treated the same as their upper-case equivalents
Section 4.3 of the textbook discusses using while loops for Input Validation. Your program must guard against bad values by validating all input data. Numeric entries must be nonzero and positive but may be entered as floating-point values. For example, a citizens weight may be entered as 147.25 kilograms. The number of solar cycles is typically reported using a floating-point format, such as 12.25. The newly revised Smithfield formula is most accurate when the parameters in the formula fall within certain well-defined ranges: Weight must be greater than 28 kilograms. Age must be between 16 and 96 solar cycles. Biximent level must be at least 30. Parameter entries that do not comply with these restrictions are always user entry errors that should be detected and rectified by your program before proceeding. All citizens have been screened to ensure compliance with these limitations. Your program should allow the user to correct inadvertent errors. Here are examples of what your report for each citizen could look like. For a citizen of gender type T, who is 34 cycles old and weighs 165 kilograms with a reported Biximent Level of 90, the Biximent Metabolic Index is 127.15, their condition is Acute and Ultraviolet therapy is recommended. Biximent Metabolic Index Report Gender: R Age: 30 cycles Weight: 150 kilograms Biximent Level: 37 BMI: 90.42 Recommended treatment: Serious Case, Medication Remember to add an additional line of output when the Biximent Metabolic Index (BMI) value for an inhabitant is greater than 200.00. Biximent Metabolic Index Report Gender: S Age: 83.25 cycles Weight: 90.5 kilograms Biximent Level: 143 BMI: 387.57 Recommended treatment: Extreme case, Hospitalization Inhabitant is Highly Contagious.
Your program should execute repeatedly allowing multiple citizens to be evaluated and providing each with their recommended treatment. To receive full credit for this programming assignment, you must: Use the correct file name, XYProjectOne.java, where X and Y are your first and last initials. For example, if your name was Edgar Polk, the file you submit should be named EPProjectOne.java. Submit a program that executes correctly. Interact effectively with the user in your prompts and error messages. Grading Guideline: Include a comment containing the students full name. (5 points) Prompt the citizen for their age in solar cycles. (5 points) Prompt the citizen for their weight in kilograms. (5 points) Prompt the citizen for their gender identification. (5 points) Use the appropriate gender factor based on their gender identification. (5 points) Prompt the citizen for their Biximent Level. (5 points) Validate all the input values. (20 points) Calculate the Biximent Metabolic Index (BMI) value correctly. (10 points) Correctly display a recommendation report showing all the input parameters. (10 points) Display the BMI value as part of the report showing two digits after the decimal point. (5 points) Determine and display the appropriate recommended treatment based on the value of the BMI. (10 points) Correctly add Highly Contagious when the BMI value is greater than 200.00. (5 points) Allow the program to repeatedly make BMI estimates. (5 points) Use prompts and error messages that were easy to understand. (5 points)
Written In Java using apache netbeans
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