Question: JAVA CODING (COUNTS + LOOPS) You are to write a program to prompt the user for data on an unknown number of patients who are

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

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!