IT 401 Business Computer Languages

etrade2016
BusinessComputerLanguagesIT401.docx

Business Computer Languages IT 401

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)

{

}

)