Question

In: Computer Science

You are working as a software developer for a large insurancecompany. Your company is planning...

You are working as a software developer for a large insurance company. Your company is planning to migrate the existing systems from Visual Basic to Java and this will require new calculations. You will be creating a program that calculates the insurance payment category based on the BMI score.

Your Java program should perform the following things:

  1. Take the input from the user about the patient name, weight, birthdate, and height.

  2. Calculate Body Mass Index.

  3. Display person name and BMI Category.

    1. If the BMI Score is less than 18.5, then underweight.

    2. If the BMI Score is between 18.5-24.9, then Normal.

    3. If the BMI score is between 25 to 29.9, then Overweight.

    4. If the BMI score is greater than 29.9, then Obesity.

  4. Calculate Insurance Payment Category based on BMI Category.

    1. If underweight, then insurance payment category is low.

    2. If Normal weight, then insurance payment category is low.

    3. If Overweight, then insurance payment category is high.

    4. If Obesity, then insurance payment category is highest.

  5. Implement exception handling.

  6. Store all the information in the file. You need to use the loop and keep asking users to enter patient name, height, weight, and birthdate. Your program should calculate BMI Category and Insurance payment category and write it to the file. Your program should stop once user enter q character.

You need to submit the following things:

  • An entire Java solution

  • An output screenshot created using Microsoft Word

Solutions

Expert Solution

Code


import java.io.BufferedWriter;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.util.Scanner;


public class BMI
{
public static void main(String[] args) throws FileNotFoundException, IOException
{
String name,date,bmiStatus,insuranceStatus;
double weight,height,BMI;
Scanner sc=new Scanner(System.in);
File fout = new File("out.txt");
   FileOutputStream fos = new FileOutputStream(fout);
BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(fos));
while(true)
{
System.out.print("Enter the name of the patient (or q to stop): ");
name=sc.next();
if(name.equalsIgnoreCase("q"))
break;
  
System.out.print("Enter the birth date of the patient (dd/mm/yyyy): ");
date=sc.next();
  
System.out.print("Enter the weight of the patient (in pound): ");
weight=sc.nextDouble();
  
System.out.print("Enter the height of the patient (in inches): ");
height=sc.nextDouble();
  
BMI= weight * 730 /(height * height);
if(BMI<18.5)
{
bmiStatus="underweight";
insuranceStatus="low";
}
else if (BMI>=18.5 && BMI<=24.9 )
{
bmiStatus="Normal";
insuranceStatus="low";   
}
else if (BMI>=25 && BMI<=29.9 )
{
bmiStatus="Overweight";
insuranceStatus="high";   
}
else
{
bmiStatus="Obesity";
insuranceStatus="highest";
}
String strDouble = String.format("%.2f", BMI);
System.out.println("BMI index calculated and write to file succesfull to file.");
bw.write("Patient Name: "+name+"\r\n"+"Birth Date: "+date+"\r\nBMI Index: "+strDouble+"\r\nBMI Category: "+bmiStatus+"\r\nInsurance payment category is:" +insuranceStatus);
bw.newLine();
bw.newLine();
System.out.println("");
  
}
bw.close();
}
  
}
output

text file


Related Solutions

You are working as a software developer for a large insurance company. Your company is planning...
You are working as a software developer for a large insurance company. Your company is planning to migrate the existing systems from Visual Basic to Java and this will require new calculations. You will be creating a program that calculates the insurance payment category based on the BMI score. Your Java program should perform the following things: Take the input from the user about the patient name, weight, birthdate, and height. Calculate Body Mass Index. Display person name and BMI...
Create a company that should be related to your major(SOFTWARE DEVELOPER) in some way or directly...
Create a company that should be related to your major(SOFTWARE DEVELOPER) in some way or directly related to your plans for the future. Once you know what that company will be and have laid out some ideas about what you will need in terms of office For this discussion board post, you need to choose three countries on three different continents and research some basic information about them with regard to starting or developing a business there. What are the...
Company is Apple Apple (who you are - Software developer) (Team you manage – App management...
Company is Apple Apple (who you are - Software developer) (Team you manage – App management ). What type of training do your employee needs? Why do they need training? Need Analysis info Determine an instructional scenario where new or revised training is appropriate; where there is an obvious gap between knowledge and performance. Determine what techniques you will use to gather data to substantiate the instructional need (surveys,questionnaires, interviews, etc). Develop a needs assessment instrument. Survey your target population/gather...
Comapny is APPLE, Inc Summarize the company. - Apple (who you are - Software developer) (Team...
Comapny is APPLE, Inc Summarize the company. - Apple (who you are - Software developer) (Team you manage – App management ). What type of training do your employee needs? Why do they need training? Need Analysis info Determine an instructional scenario where new or revised training is appropriate; where there is an obvious gap between knowledge and performance. Determine what techniques you will use to gather data to substantiate the instructional need (surveys,questionnaires, interviews, etc). Develop a needs assessment...
Choice 1. You are the new software developer at work. You are brought into a meeting...
Choice 1. You are the new software developer at work. You are brought into a meeting with clients that do not understand the idea of sorting data. Now you know, that you cannot use complex math to explain, but you can illustrate in diagrams. Basically, this group has been working with unsorted data and you must explain why their searches and reports will be so much faster with sorted data. You do not know anything specific about their data, but...
Assume that you are working for a company that develops software systems for in-house use in...
Assume that you are working for a company that develops software systems for in-house use in its design of aircraft engines. Being a software engineer you may not have any expertise in aircraft engines. While testing programs for such applications, what are the challenges you are likely to face, and how will you overcome them?
You are working for a company that is planning to invest in a foreign country. Management...
You are working for a company that is planning to invest in a foreign country. Management has requested a report regarding the attractiveness of alternative countries based on the potential return of foreign direct investment (FDI). A colleague mentioned a potentially useful tool called the FDI Confidence Index, which is updated periodically. Find this index online and analyze how the index is constructed. Discuss the countries that are ranked in the top 20 based on the FDI Confidence Index using...
You are a renowned software developer and you have been hired by an old British boyband...
You are a renowned software developer and you have been hired by an old British boyband that wants to make a comeback in the industry. They ask you to make an app to showcase their new music and events. In your implementation, you have a class for each of the 5 group members, but you find that compiling each band member’s class takes more time than you currently have. Luckily, you remember that you learned about Makefiles in your favorite...
You are the lead trainer for the software development team at a large telecommunications company. You...
You are the lead trainer for the software development team at a large telecommunications company. You have been tasked with preparing a training document that explains the principles of polymorphism, inheritance, and encapsulation. Research these principles and provide examples for each principle, showing how they would be used in software development. Be sure to answer the question of how each principle would be employed in the software development process. Java programmers use class hierarchies for the purposes of inheritance. For...
RUN THIS PROGRAM ON NETBEANS As a Software Developer, you have received a requirement from a...
RUN THIS PROGRAM ON NETBEANS As a Software Developer, you have received a requirement from a Company to implement a prototype for its payroll system. You receive the following specifications: If an employee works more than its regular hours, it is considered overtime and it will be paid based on the employee’s experience. All employees are paid biweekly (80 hours) Employee taxes: 1% This company manages three categories of workers based on employee’s experience. Group 1 (Silver) o Pay rate:...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT