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
Which data type is 2.5?
Phoenix [80]

2.5 is a float.

Float stands for floating point. Floating point types are numbers with decimal places. I hope this helps!

6 0
3 years ago
Which set of symbols encloses an if-then code block? Choose the best answer.
Colt1911 [192]

Here's some code that might help, assuming that you are using JavaScript.

e = "Hello"

if(e === "Hello"){

    alert(":D")

}else{

    console.log("Um.")

}

I think that the answer is curly brackets.

8 0
3 years ago
g Assignment 8: Driving costs Driving is expensive. Write a program with a car's miles/gallon and gas dollars/gallon as input, a
zavuch27 [327]

Answer:

miles_gallon = float(input("Enter car's miles/gallon: "))

dollars_gallon = float(input("Enter gas dollars/gallon: "))

print("Gas cost for 20 miles is $", (20 / miles_gallon) * dollars_gallon)

print("Gas cost for 75 miles is $", (75 / miles_gallon) * dollars_gallon)

print("Gas cost for 500 miles is $", (500 / miles_gallon) * dollars_gallon)

Explanation:

*The code is in Python.

Ask the user to enter the car's miles/gallon and gas dollars/gallon

Calculate the gas cost for 20 miles, divide 20 by miles_gallon and multiply the result by dollars_gallon, then print it

Calculate the gas cost for 75 miles, divide 75 by miles_gallon and multiply the result by dollars_gallon, then print it

Calculate the gas cost for 500 miles, divide 500 by miles_gallon and multiply the result by dollars_gallon, then print it

5 0
2 years ago
What should you keep in mind when adding contents to your digital portfolio?
sveticcg [70]

Answer:

The contents of the portfolio will depend on individual education, work experience and future goals

Explanation:

The contents of the portfolio will depend on the following -

a) Work biography/experiences

b) Career goals

c) personal details

d) contact information

e) Professional photograph

f) Relevant skills

g) Relevant documents, certificates, degree etc.

etc.

4 0
3 years ago
Windows administration allows a certain level of access for a file or folder to be assigned to a(n) ____________________ rather
soldi70 [24.7K]

Answer:

Group

Explanation:

A folder assigned to a single user can only be accessed by a single person, to get many users access a folder windows administrator shares a folder to a workgroup. using the simple steps below.

Login as the admin of the system, Right-click on the folder you want to give permission on, after clicking on properties, click on security, add user or group after clicking the edit. and your folder is shared to a group and all users in the group have access to it.

6 0
3 years ago
Other questions:
  • The memory allocated for a float value is ____ bytes.
    9·1 answer
  • Explain the difference between general-purpose and specialized applications. Also discuss the common features of application pro
    11·1 answer
  • 1. Why is it important to compare features of a computer before making a purchase?
    13·2 answers
  • Wice each lunar month, all year long, these tides occur. Whenever the Moon, Earth and Sun are aligned, the gravitational pull of
    5·1 answer
  • 1. Which of the following is not related to a buffer overflow? A. Static buffer overflow B. Index error C. Canonicalization erro
    10·1 answer
  • Being able to express your thoughts in an email is a primary technology skill. true or false.
    9·2 answers
  • Define Based Assessment ​
    5·1 answer
  • What is the difference between mutex lock and race condition​
    6·1 answer
  • Which of these allows the programmer to put data inside a variable?
    5·1 answer
  • What type of bus does PCI use?
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!