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
Which Supreme Court case resulted in a decree issued for the Michigan Department of Corrections to provide female inmates access
SOVA2 [1]

Answer:

GLOVER v. JOHNSON December 14th 1999 at Michigan

Explanation:

The court case mentioned above is exactly the court case that has ended with a decree being issued  through the Michigan Department of Corrections for providing female inmates the access to the programming which has previously been allowed only to the male inmates. And this happened in 1999, and some big names were part of the jurisdiction. Its a very popular case definitely.

7 0
2 years ago
How many keywords are there in C programming language
kumpel [21]
In total there are 32 keywords in the c programming language.
3 0
3 years ago
Program 7 - Circle You write ALL the code, then run it - Produce the correct output. Turn in code and screen print of successful
fgiga [73]

Answer:

Here is the Circle class:

public class Circle {   // class definition

private int radius;    // private data member of type int of class Circle named radius that stores the value of radius

public Circle(int r) {   // parameterized constructor of class Circle that takes radius as argument

 radius = r;  }    // sets value of radius as r

public int getRadius() {   // accessor method to get the value of radius

 return radius;  }   // returns the current value of radius

public int Diameter() {   // method to compute diameter of a circle

 return radius * 2;  }   // multiply radius value by 2 to compute diameter of Circle

 

public double Area() {   // method to compute area of a circle

 return Math.PI  * Math.pow(radius, 2);   }   //the formula of area is

π x radius² where value of π is get using Math.PI

 

 public double Circumference() {   // // method to compute circumference of a circle

 return 2* Math.PI * radius;   }   }  //the formula of circumference is

2 x π x radius where value of π is get using Math.PI

Explanation:

Here is the Main class:

import java.util.Scanner;  //to accept input from user

public class Main {  //definition of Main class

public static void main(String[] args) {  //start of main method

   

    Scanner scanner = new Scanner (System.in);  //creates Scanner object to take input from user

    System.out.println("Enter radius: ");  //prompts user to enter radius

    int r = scanner.nextInt();  //reads the value of radius from user

 Circle c = new Circle(r);  // calls Constructor of Circle passing r as argument to it using the object c of class Circle

 

    if(c.getRadius()<=0){  //calls getRadius method to get current value of radius using objec and checks if this value (input value of r ) is less than or equal to 0

        System.out.println("Error!");   }  //when above if condition evaluates to true then print this Error! message

    else {  //if the value of radius is greater than 0

System.out.println("the radius of this Circle is: " +c.getRadius());  //calls getRadius method to return current value of r (input value by user)

System.out.println("the diameter of this Circle  is: " + c.Diameter());  //calls Diameter method to compute the diameter of Circle and display the result on output screen

System.out.printf("the circumference of this Circle  is: %.2f", c.Circumference());  //calls Circumference method to compute the Circumference of Circle and display the result on output screen

System.out.println();  //prints a line

System.out.printf("the Area of this Circle  is: %.2f", c.Area()); } }  }

//calls Area method to compute the Area of Circle and display the result on output screen

The program and its output is attached.

7 0
3 years ago
To bundle links together in order to improve bandwidth availability and redundancy, what protocol is used
Daniel [21]

Answer:

Link Aggregation Control Protocol

Explanation:

Link Aggregation Control Protocol can be used to assist in the formation of port channel bundles of physical links.

Link Aggregation Control Protocol is an IEEE standard defined in IEEE 802.3ad. LACP lets devices send Link Aggregation Control Protocol Data Units (LACPDUs) to each other to establish a link aggregation connection.

8 0
3 years ago
Which was cited as a reason why Google became so popular?
kupik [55]

Answer:

Google became successful because its founders were well-connected. Google was the world's first and best search engine. Google changed the world by solving an old problem in a new way. Google's other products are now more important to its success than search.

Explanation:

3 0
2 years ago
Other questions:
  • Which resource helps a user access a cloud service?
    8·1 answer
  • Explain why professional software that is developed for a customer is not simply the programs that have been developed and deliv
    13·1 answer
  • What is the difference between a key escrow and a recovery agent? (Choose all that apply.)
    12·1 answer
  • Digital printing is not suitable for printing what
    11·1 answer
  • An optical fibre has an attenuation of 0.3 dB/km. If a laser launches an optical power level of PIN (mW) into 35 km length of th
    8·1 answer
  • Which line of code in this program is MOST likely to result in an error
    15·2 answers
  • Define a function below, filter_out_strs, which takes a single argument of type list. Complete the function so that it returns a
    10·1 answer
  • Help brainleist giving exam
    15·1 answer
  • How are most databases organized?
    15·1 answer
  • Another name of computer program is
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!