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.
- area = width x length
- Display What is the rooms width?
- Input width.
- Display What is the rooms length?
- Input length.
- 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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started