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

Answers

Answer 1

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++

}


Related Questions

let m be a positive integer with n bit binary representation an-1 an-2 ... a1a0 with an-1=1 what are the smallest and largest values that m could have

Answers

Answer:

Explanation:

From the given information:

[tex]a_{n-1} , a_{n-2}...a_o[/tex] in binary is:

[tex]a_{n-1}\times 2^{n-1} + a_{n-2}}\times 2^{n-2}+ ...+a_o[/tex]

So, the largest number posses all [tex]a_{n-1} , a_{n-2}...a_o[/tex]  nonzero, however, the smallest number has [tex]a_{n-2} , a_{n-3}...a_o[/tex] all zero.

The largest = 11111. . .1 in n times and the smallest = 1000. . .0 in n -1 times

i.e.

[tex](11111111...1)_2 = ( 1 \times 2^{n-1} + 1\times 2^{n-2} + ... + 1 )_{10}[/tex]

[tex]= \dfrac{1(2^n-1)}{2-1}[/tex]

[tex]\mathbf{=2^n -1}[/tex]

[tex](1000...0)_2 = (1 \times 2^{n-1} + 0 \times 2^{n-2} + 0 \times 2^{n-3} + ... + 0)_{10}[/tex]

[tex]\mathbf {= 2 ^{n-1}}[/tex]

Hence, the smallest value is [tex]\mathbf{2^{n-1}}[/tex] and the largest value is [tex]\mathbf{2^{n}-1}[/tex]

Given that the variable named Boy = "Joey" and the variable named Age = 6, create statements that will output the following message:

Congratulations, Joey! Today you are 6 years old.

First, write one statement that will use a variable named Message to store the message. (You will need to concatenate all of the strings and variables together into the one variable named Message. If you don't know what that means, read the section in Chapter 1 about concatenation.)
Then write a second statement that will simply output the Message variable.

Answers

Answer:

isn't it already showing it if not put text box

Explanation:

A structure that organizes data in a list that is commonly 1-dimensional or 2-
dimensional
Linear Section
Constant
No answertet provided
It intro technology

Answers

Answer:

An array.

Explanation:

An array can be defined as a structure that organizes data in a list that is commonly 1-dimensional or 2-dimensional.

Simply stated, an array refers to a set of memory locations (data structure) that comprises of a group of elements with each memory location sharing the same name. Therefore, the elements contained in array are all of the same data type e.g strings or integers.

Basically, in computer programming, arrays are typically used by software developers to organize data, in order to search or sort them.

Binary search is an efficient algorithm used to find an item from a sorted list of items by using the run-time complexity of Ο(log n), where n is total number of elements. Binary search applies the principles of divide and conquer.

In order to do a binary search on an array, the array must first be sorted in an ascending order.

Hence, array elements are mainly stored in contiguous memory locations on computer.

5. All sites are required to have the following reference materials available for use at VITA/TCE sites in paper or electronic format: Publication 17, Publication 4012, Volunteer Tax Alerts (VTA), and Quality Site Requirement Alerts (QSRA). AARP Foundation Tax Aide uses CyberTax Alerts in lieu of VTAs and QSRAs. What other publication must be available at each site and contains information about the new security requirements at sites

Answers

Answer:

Publication 5140.

Explanation:

The acronym VITA stands for Volunteer Income Tax Assistance and TCE stands for Tax Counseling for the Elderly. VITA/TCE is a certification gotten from the Internal Revenue Service in which the holders of such certification are trained on how to help people that have disabilities or that their incomes earners that are low. These volunteers help these set of people to prepare for their tax return.

In order to make the volunteers to be able to perform their work with high accuracy, the Department of Treasury, Internal Revenue Service gave out some aids for Quality Site. One of the aids which is the one contains information about the new security requirements at sites is given in the Publication 5140.

Approximately how many numeric IP addresses are possible with IPv4?

4 billon

Answers

Answer:

4,294,967,296 (~4.3B)

Explanation:

IPv4 uses 32-bits for representing addresses, thus you can have 2^32 total combinations.

Help need right now pls
Read the following Python code:
yards - 26
hexadecimalYards = hex (yards)
print (hexadecimalYards)
Which of the following is the correct output? (5 points)
A. 0b1a

B. 0d1a

C. 0h1a

D. 0x1a

Answers

Answer:

d. 0x1a

Explanation:

Implement the method countInitial which accepts as parameters an ArrayList of Strings and a letter, stored in a String. (Precondition: the String letter has only one character. You do not need to check for this.) The method should return the number of Strings in the input ArrayList that start with the given letter. Your implementation should ignore the case of the Strings in the ArrayList. Hint - the algorithm to implement this method is just a modified version of the linear search algorithm. Use the runner class to test your method but do not add a main method to your U7_L4_Activity_One.java file or your code will not be scored correctly.

Answers

Answer:

Answered below

Explanation:

//Program is implemented in Java

public int countInitials(ArrayList<string> words, char letter){

int count = 0;

int i;

for(i = 0; i < words.length; i++){

if ( words[i][0]) == letter){

count++

}

}

return count;

}

//Test class

Class Test{

public static void main (String args[]){

ArrayList<string> words = new ArrayList<string>()

words.add("boy");

words.add("bell");

words.add("cat");

char letter = 'y';

int numWords = countInitials ( words, letter);

System.out.print(numWords);

}

}

Other Questions
hello My name es Liliana y arigato bye What is the relationship between the word pairs in the analogy?agitated : excited as peaceful: quietA. Cause and effectB. SynonymsC. Part-wholeO D. Antonyms Convert 6 months to years Which poster was created to motivate Americans to grow victory gardens.(THE ANSWER IS ON THE IMAGE) Determine the intercepts of the line x-intercept How do atoms in molecules bond? plz answer I will give brainliest What was the purpose of adding the ceiling feature into a building Find the product of (1)(3)(x).Youranswer Item 5 Which sentence is correct?Books like "Hidden Figures' motivate us by describing the real-life achievements of others,o Books like Hidden Figures motivate us by describing the real-life achievements of others.Books like Hidden Figures motivate us by describing the real-life achievements of others.Books like Hidden Figures motivate us by describing the real-life achievements of others. Describe what a shatter belt is in your own words. Define the terms heredity and inherited in your own words. Help pleas brainliest promise PLEASE HELPPPUse the following words to compose complete sentences. Make all the necessary changes to ensure agreement.18. Quel / pomes / tu / apprendre19. Ils / crire / ce / notes20. Vous / dire / rienAnswer the following questions using the hints in parentheses. Compose complete sentences.11. Quelqu'un est venu? (No, nobody)14. Tu veux encore de la salade? (No, no more) Where do the projection lines converge in a perspective sketch? Guys help Ive been trying to solve this problem for the past 40 minutes. Which was a major cause for the entry of the US into World War I?The desire to collect reparationsGermanys invasion of BelgiumGermanys decision to resume unrestricted submarine warfareRussias decision to leave the war Chapter 2 and 3 guilded notes Articles of confederation Complete the sentence with the correct form of aimer:Alex et moi n' pas les films.aimezO aimentaimesaimons HURRY 1/12 is the same as 112. What is the exact quotient in decimal form of 112? I NEED HELP, THIS IS VERY URGENT!!! ANSWER IN COMPLETE AND DETAILED SENTENCES PLZ!!Why is it important to include families in the collection of information for observations? What are the benefits of observation for parents and caregivers?