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
Tpy6a [65]
3 years ago
11

How to do pseudocode and flowchart in BMI ( computer programming ​

Computers and Technology
1 answer:
defon3 years ago
5 0

Answer:

You need to find out what is the units of measurement of the height and weight. You also need to find that the weight is in Kilogram or pounds, and whether the height is in feet and inches, or inches, or meters and centimeters.

Part1: You need to read the values of the weight and height, and validate it as required.

Part2: Now you need to convert those findings into English measures or metrics for computation.

Part3: Output: You need to display as well as echo the input as well as the BMI; and you need to mention the supplementary message which is based on the BMI findings related to Obesity, borderline overweight, normal and overweight, etc.

The program is as below:

import java.io. *;

class Main

{

// weight in pounds and heights are in inches

private double your_wght;

private double your_hght;

Main ( double ht, double wt)

{

your_wght = wt; your_hght = ht;

}

public double GetHght() { return(your_hght); }

public double GetWght() { return(your_wght); }

public double CalculBMI() { return(your_wght*703/(your_hght*your_hght)); }

public double PrintDouble( String promptMessage) throws IOException

{

double Num=0;

String x=null;

Console console = System.console();

System.out.print(promptMessage);  

x = console.readLine();  

Num = Double.parseDouble(x);

return(Num);  

}  

public static void main( String args[])

{

double heightinFeet=0,heightinInch=0,w=0;

Main Input = new Main(0,0);

try

{

System.out.println(" Please input the height(feet/inches) \n");

heightinFeet = Input.PrintDouble(" In feet :> ");

heightinInch = Input.PrintDouble(" In inches :> ");

w = Input.PrintDouble(" Please enter the weight(pounds) :>");

}

catch (IOException ex) { System.out.println("occurred Input Exception"); }  

Main BMI_value = new Main(heightinFeet*12+heightinInch,w);  

System.out.println(" Weight = " + BMI_value.GetWght() );  

System.out.println(" Height(inches) " + BMI_value.GetHght() );

System.out.println(" BMI is " + BMI_value.CalculBMI() );  

}

}

Explanation:

Rest of the fields and properties are self understood, however, PrintMessage needs explanation. It takes a string as input, which calls for entering some double value like in feet, and in inches, and returns that value, which is assigned to relevant double variable. And Main is the class with Main constructor, which is a parameterized constructor, and takes height and weight as input.

You might be interested in
Els
galina1969 [7]

Answer:

ds2d2d2d2dd

Explanation:

3 0
3 years ago
Convert infix to postfix
kvv77 [185]

Answer:

static int checkSymbol(char ch)

{

switch (ch)

{

case '+':

case '-':

return 1;

case '*':

case '/':

return 2;

case '^':

return 3;

}

return -1;

}

static String convertInfixToPostfix(String expression)

{

String calculation = new String("");

Stack<Character> operands = new Stack<>();

Stack<Character> operators = new Stack<>();

 

for (int i = 0; i<expression.length(); ++i)

{

char c = expression.charAt(i);

if (Character.isLetterOrDigit(c))

operands.push(c);

else if (c == '(')

operators.push(c);

 

else if (c == ')')

{

while (!operators.isEmpty() && operators.peek() != '(')

operands.push(operators.pop());

 

if (!operators.isEmpty() && operators.peek() != '(')

return NULL;    

else

operators.pop();

}

else

{

while (!operators.isEmpty() && checkSymbol(c) <= checkSymbol(operators.peek()))

operands.push(operators.pop());

operators.push(c);

}

}

while (!operators.isEmpty())

operands.push(operators.pop());

while (!operands.isEmpty())

calculation+=operands.pop();

calculation=calculation.reverse();

return calculation;

}

Explanation:

  • Create the checkSymbol function to see what symbol is being passed to the stack.
  • Create the convertInfixToPostfix function that keeps track of the operands and the operators stack.
  • Use conditional statements to check whether the character being passed is a letter, digit, symbol or a bracket.
  • While the operators is  not empty, keep pushing the character to the operators stack.
  • At last reverse and return the calculation which has all the results.
4 0
3 years ago
I need help!!! i will make you a brainliest!!
Ber [7]

Answer:

What you have is correct

Explanation:

3 0
3 years ago
An attribute that can have more than one value for each entity instance is referred to as:
ss7ja [257]

Answer:

D) a multivalued attribute

Explanation:

A multivalued attribute  can have more than one value associated with the entity key.

6 0
3 years ago
nder a Huffman encoding ofnsymbols with frequenciesf1, f2, . . . , fn, what is the longest a codewordcould possibly be
Natasha2012 [34]

Answer:

The longest codeword that could possibly be for "n" symbol is n-1 bits.

Explanation:

From the given information:

Suppose we are to consider a set of frequencies \mathtt{f_1,f_2,f_3 ...,f_n}, for which f is a symbol for the length n. Therefore, the longest codeword that could possibly be for "n" symbol is n-1 bits.

However, during the encoding for "n" in conjunction with n-2, then the possibilities for n are; \mathtt{\dfrac{1}{2}, \dfrac{1}{4}, ... \dfrac{1}{2^{n-2}}}

We can conclude that the longest codeword that could possibly be for "n" symbol is n-1 bits.

5 0
3 years ago
Other questions:
  • You are researching RAM for a computer you are building for a friend who will be using the system as a home office server for he
    13·1 answer
  • What keyboard command opens the Go To dialog box?
    11·2 answers
  • Which one is a run-on sentence? you get mark the brilist
    5·2 answers
  • 4. An advantage presented by straight-in spaces is that
    12·1 answer
  • which of the following is a component of a rope-rewind starter system? a. a recoil spring c. an air vane governor b. a wrist pin
    5·1 answer
  • Describe the components of a CPU--the CU, ALU, and Cache--and explain how they interact to make the CPU function.
    13·1 answer
  • Why does my inbox keep getting notifications and then disappearing?
    15·2 answers
  • Explain the differences between copyright, fair use, and trademark?
    13·1 answer
  • Creating a Numpy Array
    5·1 answer
  • The bullet points above describe _____.
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!