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]
2 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]2 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
Write a while loop that prints userNum divided by 2 (integer division) until reaching 1. Follow each number by a space.
Ksenya-84 [330]

Answer:

   while(userNum>=1){

       System.out.print(userNum/2+" ");

       userNum--;

        }

Explanation:

This is implemented in Java programming language. Below is a complete code which prompts a user for the number, receives and stores this number in the variable userNum.

<em>import java.util.Scanner;</em>

<em>public class TestClock {</em>

<em>    public static void main(String[] args) {</em>

<em>    Scanner in = new Scanner (System.in);</em>

<em>        System.out.println("Enter the number");</em>

<em>    int userNum = in.nextInt();</em>

<em>    while(userNum>=1){</em>

<em>        System.out.print(userNum/2+" ");</em>

<em>        userNum--;</em>

<em>         }</em>

<em>    }</em>

<em>}</em>

The condition for the while statement is userNum>=1 and after each iteration we subtract 1 from the value of   userNum until reaching 1 (Hence userNum>=1)

3 0
3 years ago
Which IDEs support multiple high-level programming languages? Select all that apply.
nata0808 [166]

Answer:

eclipse, xcode, and visual studio

6 0
2 years ago
Read 2 more answers
Consider two different implementations, M1 and M2, of the same instruction set. There are three classes of instructions (A, B, a
Margaret [11]

Explanation:

A.)

we have two machines M1 and M2

cpi stands for clocks per instruction.

to get cpi for machine 1:

= we multiply frequencies with their corresponding M1 cycles and add everything up

50/100 x 1 = 0.5

20/100 x 2 = 0.4

30/100 x 3 = 0.9

CPI for M1 = 0.5 + 0.4 + 0.9 = 1.8

We find CPI for machine 2

we use the same formula we used for 1 above

50/100 x 2 = 1

20/100 x 3 = 0.6

30/100 x 4 = 1.2

CPI for m2 =  1 + 0.6 + 1.2 = 2.8

B.)

CPU execution time for m1 and m2

this is calculated by using the formula;

I * CPI/clock cycle time

execution time for A:

= I * 1.8/60X10⁶

= I x 30 nsec

execution time b:

I x 2.8/80x10⁶

= I x 35 nsec

6 0
2 years ago
Um i'm new here... and i don't know really how to use this... i was wondering if som 1 can help me
blagie [28]

Shining and warm

Collapse 3

JOJO

fate series

Bungou Stray Dog

EVA

Dao Master

Alien invasion

Future diary

Fate of Space

Story Series

Beyond the Boundary

Bayonetta

Onmyoji

Full-time master

How to develop a passerby heroine

Illusion Front

Psychometer

your name

Noragami

One Piece

Senran Kagura

Attacking Giant

Kabaneri of the Iron Fortress

Violet Evergarden

Demon Slayer

Under one person

Guilt crown

Black reef

Star Cowboy

Black Street Duo

Aria the Scarlet Ammo

Hatsune Miku

The last summoner

re creator

Detective Conan

Naruto

grim Reaper

Tokyo Ghoul

Song of Hell

At the beginning

Sword Art Online

Girl opera

Hakata pork bones pulled dough

Sunny

Black bullet

Trembling

On the broken projectile

Black Butler

Destiny's Gate

Persona

God Prison Tower

April is your lie

Ground-bound boy Hanako-kun

League of legends

Clever girl will not get hurt

Tomorrow's Ark

DARLING in the FRANKXX

RWBY

Little Busters

dating competition

Gintama

One Punch Man

The promised neverland

Taboo curse

God of college

Queen of Arms

Sword Net 3

Final fantasy

6 0
2 years ago
Read 2 more answers
Most networking media send data using _____ in which data is represented by only two discrete states: 0s and 1s.
dlinn [17]

Answer:

i think digital signals

Explanation:

A digital signal is a signal that is being used to represent data as a sequence of discrete values; at any given time it can only take on one of a finite number of values.[1][2][3] This contrasts with an analog signal, which represents continuous values; at any given time it represents a real number within a continuous range of values.

6 0
3 years ago
Read 2 more answers
Other questions:
  • (1) Prompt the user to input an integer between 32 and 126, a float, a character, and a string, storing each into separate varia
    7·1 answer
  • C++
    11·1 answer
  • Complete the do-while loop to output every number form 0 to countLimit using printVal. Assume the user will only input a positiv
    9·1 answer
  • Are to print or find<br> the sum<br> 5 numbers<br> of<br> using flow chart
    6·1 answer
  • How many points do I need to be able to message people
    9·2 answers
  • Write a function named last_digit that returns the last digit of an integer. For example, last_digit(3572) should return 2. It s
    5·1 answer
  • One problem with _______ is that often many copies of the same document are made. <br><br>HELPPP ​
    11·1 answer
  • Does anyone know this? Can someone please help me? I’ll give brainliest!!
    7·1 answer
  • What is the difference between a status bar, title bar, and tabs?
    15·1 answer
  • a value-returning method must specify as its return type in the method header. question 18 options: a) an int b) a double c) a b
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!