Question
JAVA CODING (COUNTS + LOOPS) . You are to write a program to prompt the user for data on an unknown number of patients who
JAVA CODING (COUNTS + LOOPS)
.
You are to write a program to prompt the user for data on an unknown number of patients who are having total joint surgery. (you will prompt until the user wishes to stopyou will need a while loop) You are to use dialog boxes for the input.
.
The data for the patient that you will read is as follows:
Type of data
The patients last name String
The location of the surgery (AGH or UPMC) String
The type of surgery (Knee or Hip) String
Fee paid by insurance double
Name of the Surgeon (Johnson, Atkins or Smith) String
.
You are then to do the following:
Print the count of Knee surgeries and the count of Hip surgeries
Print the average Fee paid at each surgery location
Print the count of surgeries of each Doctor
Print the name of the Doctor doing the most surgeries
Print the name of the patient whose insurance paid the highest fee, the name of the Doctor doing that surgery and the location of that surgery
.
**Please note** For those of you who know how to code arrays, I do not want you to use arrays on this assignment.
.
Copy the source code and screen shots of the program running to word and upload the word document to D2L
You should take a very structured approach to this assignment. Read all data first. Then code one of the tasks, get it to work and then move on to the next task. Do not try to accomplish all at once.
You will need to define various other variables in your code, such as a count for the number of surgeries at AGH. Define all of your variables at the very beginning of your code.
When working with strings, to do a comparison, you have to do something like this:
.
String location;
location =JOptionPane.showInputDialog(null,"Enter the Location of the surgery","Input",JOptionPane.QUESTION_MESSAGE);
if(location.equals(AGH)
agh_count=agh_count+1;
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