Question: JAVA, Chapter 1 Find the Error 1. The following pseudocode algorithm has an error. The program is supposed to ask the user for the length

JAVA, Chapter 1

Find the Error

1. The following pseudocode algorithm has an error. The program is supposed to ask the user for the length and width of a rectangular room, and then display the rooms area. The program must multiply the width by the length to determine the area. Find the error.

  1. area = width x length
  2. Display What is the rooms width?
  3. Input width.
  4. Display What is the rooms length?
  5. Input length.
  6. Display area.

Predict the Result

The following are programs expressed as English statements. What would each display on the screen if they were actual programs?

2. The variable x starts with the value 0. The variable y starts with the value 5. Add 1 to x. Add 1 to y. Add x and y, and store the result in y. Display the value in y on the screen.

3. The variable a starts with the value 10. The variable b starts with the value 2. The variable c starts with the value 4. Store the value of a times b in a. Store the value of b times c in c. Add a and c, and store the result in b. Display the value in b on the screen.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!