1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
asambeis [7]
3 years ago
8

Write a java program named BMI.java(i)print out your name and your pantherID(ii) Ask user to type in his/her weight and height;

if an illegal input (such as a letter) is typed by the user, give the user one more chance to input correctly.(iii)Create a method to compute the body mass index (BMI) accordingly. BMI
Computers and Technology
1 answer:
anyanavicka [17]3 years ago
3 0

Answer:

Answered below

Explanation:

//Print name and ID

Scanner x = new Scanner(System.in);

System.out.print("Enter name");

String name = x.nextline();

Scanner y = new Scanner(System.in);

System.out.print("Enter ID");

int id = y.nextline();

System.out.println(name, id);

Scanner w = new Scanner(System.in);

System.out.print("enter weight");

double weight = w.nextline();

Scanner h = new Scanner(System.in);

System.out.print("enter height: ");

double height = h.nextline();

int i = 0;

while( I < 2){

if ( !isDigit(weight) && !isDigit(height){

Scanner w = new Scanner(System.in);

System.out.print("enter weight:);

weight = w.nextline();

Scanner h = new Scanner(System.in);

System.out.print("enter height");

height = h.nextline();

}else{

break;

double BMI = weight / ( height **2)

System.out.print(BMI)}

I++

}

You might be interested in
Which term best describes the operating system of a computer
ololo11 [35]

Answer: System Software

Explanation:

7 0
3 years ago
What is output if the user enters -5?
7nadin3 [17]

Answer:

The left

Explanation:

6 0
3 years ago
Read 2 more answers
Which of the following may present a problem for Linux users?
motikmotik
Tendancy to crash hope that helped
6 0
4 years ago
Read 2 more answers
THE DOMAIN IN AN EMAIL MESSAGE TELLS YOU THE
german
The domain in an email message tells you the type of service provider.

Hope this helped! :)
3 0
4 years ago
What are examples of macro events related to a form? Check all that apply.
Westkost [7]

Answer:

A form is closed

A form is resized.

A form is opened

A user presses a key

A user moves the mouse

Explanation:

There are different events in a form, and we can use them in different situations like:

  • We can use On Resize to resize our form.
  • If we On Load the form will be displayed.
  • On Clicked, If there was a click in an object
  • On Unload to close the form.
  • On Mouse Enter and On Mouse Leave, in this case, the mouse enters or leaves the object.

6 0
4 years ago
Other questions:
  • Arpanet was developed by the united states so that there was a communication network that would survive a nuclear war. True or F
    11·1 answer
  • Create a script that asks for the visitor's weight in pounds and his/her height in inches. The program should then calculate the
    13·1 answer
  • What are the correct steps to find the system specifications such as the amount of RAM or system type?
    13·1 answer
  • I have a question. This question will probably be deleted, but why do moderators keep deleting my answers when they are legitima
    13·1 answer
  • What are the economic, social, political and cultural effects of the West Indian Day Parade
    12·1 answer
  • The visitor's age is stored in the variable age, the day of the week is stored in a variable day, and the price in dollars is st
    8·1 answer
  • What is the difference btween a microcontroller a mini computer?
    15·2 answers
  • 1. In platform construction, wall-framing members include sole plates,
    15·2 answers
  • Which of the following is a document view you can select using Button on the status bar?
    11·1 answer
  • Which characters are used in hump notion?
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!