Evaluate the given pseudocode to calculate the body mass index (BMI) with the following test values:
A) The height = 1.80 meter and the weight = 78 Kg
B) The height = 1.50 meter and the weight = 85 Kg
Input height
Input weight
BMI = Weight / (height)2
If BMI < 18.5 then
Output BMI
Output “Underweight” Else
If BMI < 24.9 then
Output BMI
Output “Normal”
Else
If BMI > 25 then
Output BMI
Output “overweight”
End if
What is the final output of:
A)
B)
Write an algorithm to find the perimeter and the area of a rectangle.
. Find the errors in the following statements, explain why and how to solve such errors:
a. 23 = 25;
b. Int percentage% = “15”;
c. Rectangle void = new Rectangle (25, 30, 40, 50);
d. double 7average = 0;
7average.length();
We want to create a class that represents a clock. A clock has hour, minute, and second. For example, the time 12:15:36 means, it is 12 o’clock, 15 minutes, and 36 seconds. The basic framework of a Clock class is below: public class Clock
{ private int hour;
private int minutes;
private int seconds;
}
1. What should the body of the constructor be?
A. hr = hour;
min = minutes;
sec = seconds;
B. hour = 12;
minutes = 15;
seconds = 36;
C. int hour = hr;
int minutes = min;
int seconds = sec;
D. hour = hr;
minutes = min;
seconds = sec;
What are the implicit and the explicit parameters in the following methods call: A) System.out.println(“Assignment 1”);
B) myName.length()
Write the body for addition, subtraction, multiplication and division methods for the Calculator class
import java.lang.*;
import java.util.*;
public class Calculator
{ private int value;
private int x;
private int y;
public Calculator()
{
value = 0;
x = 0;
y = 0;
}
public int addition(int x, int y)
{
}
public int subtraction(int x, int y)
{
}
public int multiplication(int x, int y)
{
} public double division(int x, int y)
{
}
)
Delivering a high-quality product at a reasonable price is not enough anymore.
That’s why we have developed 5 beneficial guarantees that will make your experience with our service enjoyable, easy, and safe.
You have to be 100% sure of the quality of your product to give a money-back guarantee. This describes us perfectly. Make sure that this guarantee is totally transparent.
Read moreEach paper is composed from scratch, according to your instructions. It is then checked by our plagiarism-detection software. There is no gap where plagiarism could squeeze in.
Read moreThanks to our free revisions, there is no way for you to be unsatisfied. We will work on your paper until you are completely happy with the result.
Read moreYour email is safe, as we store it according to international data protection rules. Your bank details are secure, as we use only reliable payment systems.
Read moreBy sending us your money, you buy the service we provide. Check out our terms and conditions if you prefer business talks to be laid out in official language.
Read more