Question

- A pseudo code that prompts the user for the grades of four exams and prints...

- A pseudo code that prompts the user for the grades of four exams and prints its average and then code in JAVA

- A pseudo code that prompts the user for value in meters and converts it to feet and inches. Print both results.  and then code in JAVA

-A pseudo code that will calculate the users Body Mass Index (BMI) and then display it for the user to see. Prompt the user to input their weight (in pounds) and their height (in inches).BMI = ( weight in pounds * 703 ) / (height in inches) 2  and then code in JAVA

0 0
Add a comment Improve this question Transcribed image text
Answer #1

1.

CODE:

import java.util.Scanner;

public class Main
{
public static void main(String[] args) {
int g1, g2, g3, g4;
float avg;

Scanner scan=new Scanner(System.in);
System.out.println("Enter grade of Exam 1");
g1=scan.nextInt();

System.out.println("Enter grade of Exam 2");
g2=scan.nextInt();

System.out.println("Enter grade of Exam 3");
g3=scan.nextInt();

System.out.println("Enter grade of Exam 4");
g4=scan.nextInt();

avg= (g1+g2+g3+g4)/4;
System.out.println("Average is: "+avg);
}
}

SCREENSHOT AND OUTPUT:

2.

CODE:

import java.util.Scanner;

public class Main
{
public static void main(String[] args) {
double meter, feet, inches;

Scanner scan=new Scanner(System.in);
System.out.println("Enter value in meters");
meter=scan.nextDouble();

feet= meter/0.3048;
System.out.format("In feet: %.2f ",feet);

inches=meter*39.37;
System.out.format("\nIn feet: %.2f ",inches);
}
}

SCREENSHOT AND OUTPUT:

3.

CODE:

import java.util.Scanner;

public class Main
{
public static void main(String[] args) {
float BMI, height, weight;

Scanner scan=new Scanner(System.in);
System.out.print("Enter weight in pounds: ");
weight=scan.nextFloat();

System.out.print("Enter height in inches: ");
height=scan.nextFloat();

BMI= (weight*703)/(height*height);

System.out.format("\nBMI index: %.2f ",BMI);
}
}

SCREENSHOT AND OUTPUT:

Add a comment
Know the answer?
Add Answer to:
- A pseudo code that prompts the user for the grades of four exams and prints...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Write a Java program that performs these operations Prompt the user to enter a low height...

    Write a Java program that performs these operations Prompt the user to enter a low height in feet (an integer) Prompt the user to enter a high height in feet (an integer) Prompt the user to enter a low weight in pounds (an integer) Prompt the user to enter a high weight in pounds (an integer) Print a table of Body Mass Index (BMI) for the heights and weights entered, ranging from the low height to the high height (inclusive),...

  • 1. Write a personalized BMI calculator in the form of a function called  bmi_calculator(). This function prompts...

    1. Write a personalized BMI calculator in the form of a function called  bmi_calculator(). This function prompts the user for their appelation, their first name, their last name, their height in inches, their weight in pounds, and prints a message of the form: BMI Record for _APPELATION _FIRSTNAME _LASTNAME: Subject is _X feet _Y inches tall and weighs _Z pounds. The subject's BMI is _B. (The words preceded by _ are replaced with the input provided by the user.) Your solution...

  • /////////////////////////////////////////////////////////////////////////////////// //This program // 1. asks the user her/his weight and height // 2. then calculates...

    /////////////////////////////////////////////////////////////////////////////////// //This program // 1. asks the user her/his weight and height // 2. then calculates the user's body-mass-index (BMI) // 3. and then prints an appropriate message based on the user's BMI /////////////////////////////////////////////////////////////////////////////////// #include <iostream> using namespace std; void printWelcome(); // ask the weight (in pounds) and height (in inches) of the user and store the values in formal // parameters weight and height, respectively void getWeightAndHeight(float& weight, float& height); // calculate and return the BMI (Body-Mass-Index) based on...

  • c++ pls 10D yUur Tugt Sna you will have to re-take it at another time PROBLEM...

    c++ pls 10D yUur Tugt Sna you will have to re-take it at another time PROBLEM 1 Body Mass Index (BMI) is a measure of body fat that is useful in screening for health issues. To calculate a BMi, you need the height in inches and the weight in pounds. You square the height, then divide the weight in pounds by the squared-height. BMI is defined in terms of meters and kilograms, so to convert from pounds and inches to...

  • IT Java code In Lab 8, we are going to re-write Lab 3 and add code...

    IT Java code In Lab 8, we are going to re-write Lab 3 and add code to validate user input. The Body Mass Index (BMI) is a calculation used to categorize whether a person’s weight is at a healthy level for a given height. The formula is as follows:                 bmi = kilograms / (meters2)                 where kilograms = person’s weight in kilograms, meters = person’s height in meters BMI is then categorized as follows: Classification BMI Range Underweight Less...

  • Design a modular program using pseudo-code which prompts a user for their first name, followed by...

    Design a modular program using pseudo-code which prompts a user for their first name, followed by their last name; then displays a "Hello" salutation which concatenates their first name with their last name. Sample output (user input shown in red): Please enter your first name: John Please enter your last name: Smith Hello, John Smith! Your program must include a main module and one function; this function prompts the user for either their first name or last name, using a...

  • In Java Body mass index is a measure of whether someone's weight is appropriate for their...

    In Java Body mass index is a measure of whether someone's weight is appropriate for their height. A body- mass-index value between 19 and 25 is considered to be in the normal range. Here's the formula for calculating body mass index: BMI- (704 x weight in pounds) / height in inches*2 a) Implement a program that prompts the user for height and weight values and displays the associated body mass index. Perform input validation by making sure that the user...

  • Please solve the following, please type out the code, and do not hand write because its...

    Please solve the following, please type out the code, and do not hand write because its hard to read. I would greatly appreciate it. (JAVA) Problem 1 In a class called H1P1, write a method called bmiOne that takes as arguments a mass in kilograms (a double) and a height in meters (also a double), and returns the body mass index (or BMI) for the given data. If we have mass -m kg and height-h meters, then BMI = Write...

  • The body mass index (BMI estimates the amount of fat in a person's body. It is defined as the person's mass m in kilograms divided by the square of the person's height h in meters. Write...

    The body mass index (BMI estimates the amount of fat in a person's body. It is defined as the person's mass m in kilograms divided by the square of the person's height h in meters. Write the formula for BMI in terms of m and h. 0 BMI In the United States, most people measure weight in pounds and height in feet and inches. When weight W is measured in pounds and height h is measured in inches, the BMI...

  • python2.7 25 Points. Create a class named BMIGUI with the following behavior. A template has been...

    python2.7 25 Points. Create a class named BMIGUI with the following behavior. A template has been provided for you and you cannot modify the template. You must use grid) to format the interface and you must get as close as possible the layout shown below. The entry box has a width parameter in its constructor you can use to make the box smaller 3. The BMI categories are as follows: Underweight= <18.5 Normal weight18.5-24.9 . Overweight 25-29.9 Obese BMI of...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT