1. If the following pseudocode were an actual program, why would it not display the output that the programmer expects?   Declare String favoriteFood Display "What is the name of your favorite food?" Input favoriteFood Display "Your favorite food is " Display "favoriteFood"   2. If the programmer translates the following pseudocode to an actual programming language, a syntax error is likely to occur. Can you find the error?   Declare String 1stPrize Display "Enter the award for first prize." Input 1stPrize Display "The first prize winner will receive ", 1stPrize   3. The following code will not display the results expected by the programmer. Can you find the error?   Declare Real lowest, highest, average Display "Enter the lowest score." Input lowest Display "Enter the highest score." Input highest Set average = low + high / 2 Display "The average is ", average, "."   4. Find the error in the following pseudocode.   Display "Enter the length of the room." Input length Declare Integer length   5. Find the error in the following pseudocode.   Declare Real pi Set 3.14159265 = pi Display "The value of pi is ", pi

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter7: Characters, Strings, And The Stringbuilder
Section: Chapter Questions
Problem 7PE
icon
Related questions
Question
100%

1. If the following pseudocode were an actual program, why would it not display the output that the programmer expects?

 

Declare String favoriteFood

Display "What is the name of your favorite food?"

Input favoriteFood

Display "Your favorite food is "

Display "favoriteFood"

 

2. If the programmer translates the following pseudocode to an actual programming language, a syntax error is likely to occur. Can you find the error?

 

Declare String 1stPrize

Display "Enter the award for first prize." Input 1stPrize

Display "The first prize winner will receive ", 1stPrize

 

3. The following code will not display the results expected by the programmer. Can you find the error?

 

Declare Real lowest, highest, average

Display "Enter the lowest score."

Input lowest

Display "Enter the highest score."

Input highest

Set average = low + high / 2

Display "The average is ", average, "."

 

4. Find the error in the following pseudocode.

 

Display "Enter the length of the room."

Input length

Declare Integer length

 

5. Find the error in the following pseudocode.

 

Declare Real pi

Set 3.14159265 = pi

Display "The value of pi is ", pi

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
Programming with Microsoft Visual Basic 2017
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning