Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

1. Briefly explain the problem solving and program development process (no more

ID: 3637727 • Letter: 1

Question


1. Briefly explain the problem solving and program development process (no more than ½ page).
2. Why do we need to compile java programs before executing them? Clearly explain your answer.

3. Mad Lib Program: Write a program that plays the game of Mad Lib. Your program should prompt the user to enter the following data:
a) Name of the instructor
b) Your name
c) A food
d) A number between 100 and 120
e) An adjective
f) A color
g) An animal
After the data is entered, they should be substituted into the story below and output to the console.



Dear Instructor [Instructor Name],

I am sorry that I am unable to turn in my homework at this time. First, I ate a rotten [Food], which made me turn [Color] and extremely ill. I come down with a fever of [Number 100 – 200]. Next, my [Adjective] pet [Animal] must have smelled the remains of the [Food] on my homework, because he ate it. I am currently rewriting my homework and hope you will accept it here.

given)

Part II – 10 Points
Note: Before attempting this question read the algorithm design related lecture notes (Rectangle and class average problems discussed in the class. Then, design the algorithm to solve the problem first. Finally write the Java program to implement your algorithm.

4. [10 Points] Body Mass Index (BMI) calculator Program: BMI is an important indicator of one’s health. Following formula is used in calculating BMI. Write a program that asks the user to input weight in pounds and height (feet and inches) and then calculate the BMI. Your program should produce a user interface similar to the one shown below.

BMI =
( lbs/inches² ) (weight in pounds * 703 )
————————————
height in inches²

Explanation / Answer

Object o = new Integer(7); String t, u; // compiler will allow this, but it will fail at runtime t = (String) o; u = t.toUpperCase();