Question

Find the error/errors in the following pseudo code. Describe the place or line in the code...

Find the error/errors in the following pseudo code. Describe the place or line in the code where the error will occur and give a clear explanation

  1. Module main()
  2. Declare Integer value1, value2, value3
  3. Display "Enter the first value."
  4. Input value1
  5. Display "Enter the second value."
  6. Input value2
  7. Display "Enter the third value."
  8. Input value3
  9. Set sum = value1 + value2 + value3
  10. Display The sum of numbers is , sum
  11. End Module

Homework Answers

Answer #1

The erros in the code is that the statement where we are displaying teh final sum , that should be a strign else it will be treated as a variable which is undefined and invalid

Display The sum of numbers is , sum

should be

Display " The sum of numbers is ", sum

The quotes are necessary to treat that as a string

So the final code will be

  1. Module main()
  2. Declare Integer value1, value2, value3
  3. Display "Enter the first value."
  4. Input value1
  5. Display "Enter the second value."
  6. Input value2
  7. Display "Enter the third value."
  8. Input value3
  9. Set sum = value1 + value2 + value3
  10. Display "The sum of numbers is ", sum
  11. End Module
Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
What will be the expected output of the following pseudo code? Write exactly what would display...
What will be the expected output of the following pseudo code? Write exactly what would display when you execute the statements. Module main() Declare Integer number Display "Enter a number and I will display" Input number Call doubleNumber(number) Display number End Module Module doubleNumber(Integer value) Declare Integer result Set result = value * 2 Display result End Module
Find the error in the following pseudocode. Module main()     Declare Real mileage     Call getMileage()...
Find the error in the following pseudocode. Module main()     Declare Real mileage     Call getMileage()     Display "You've driven a total of ", mileage, " miles." End Module Module getMileage()     Display "Enter your vehicle’s mileage."     Input mileage End Module
There are 7 syntax errors and 3 semantic errors in the following code segment. Please mark...
There are 7 syntax errors and 3 semantic errors in the following code segment. Please mark them in the code and explain the reason briefly in place. #include<iostream> using namespace std; int main() { cout<<”Please input the radius (in integer): ”>>endl; int 1var = 10, var=20; double area = 40; cin<< var; //get an input of the radius and store in var float continue; float const pi = 2.64; pi += 0.5; do { cout<<”The radius is ”<<”var”<<endl; //print the...
Part A. Input Validation (Name your C program yourLastName_yourFirstName_Lab4a.c) 1. Place the code you developed in...
Part A. Input Validation (Name your C program yourLastName_yourFirstName_Lab4a.c) 1. Place the code you developed in Lab 2 to obtain a diameter value from the user and compute the volume of a sphere (we assumed that to be the shape of a balloon) in a new program, and implement the following restriction on the user’s input: the user should enter a value for the diameter which is at least 8 inches but not larger than 60 inches. Using an if-else...
What would the pseudocode be for this? The code for this has already been answered. I...
What would the pseudocode be for this? The code for this has already been answered. I need the pseudocode. Credit card numbers typically consist of 13, 15, or 16 digits. For example, 4690 3582 1375 4657 is a hypothetical credit card number. The first digit designates the system. In (3.1.1), the first digit, 4, shows that the card would be a Visa card. The following digits specify other information such as the account number and bank number. (The precise meaning...
PHP calculator problem Create a calculator class that will add, subtract, multiply, and divide two numbers....
PHP calculator problem Create a calculator class that will add, subtract, multiply, and divide two numbers. It will have a method that will accept three arguments consisting of a string and two numbers example ("+", 4, 5) where the string is the operator and the numbers are what will be used in the calculation. It doesn't need an HTML form, all the arguments are put in through the method. The class must check for a correct operator (+,*,-,/), and a...
(For Python) Evaluating Postfix Arithmetic Expressions. In this project you are to implement a Postfix Expression...
(For Python) Evaluating Postfix Arithmetic Expressions. In this project you are to implement a Postfix Expression Evaluator as described in section 7-3b of the book. The program should ask the user for a string that contains a Postfix Expression. It should then use the string's split function to create a list with each token in the expression stored as items in the list. Now, using either the stack classes from 7.2 or using the simulated stack functionality available in a...
8.15 *zyLab: Method Library (Required & Human Graded) This code works but there are some problems...
8.15 *zyLab: Method Library (Required & Human Graded) This code works but there are some problems that need to be corrected. Your task is to complete it to course style and documentation standards CS 200 Style Guide. This project will be human graded. This class contains a set of methods. The main method contains some examples of using the methods. Figure out what each method does and style and document it appropriately. The display method is done for you and...
Using the following code perform ALL of the tasks below in C++: ------------------------------------------------------------------------------------------------------------------------------------------- Implementation: Overload input...
Using the following code perform ALL of the tasks below in C++: ------------------------------------------------------------------------------------------------------------------------------------------- Implementation: Overload input operator>> a bigint in the following manner: Read in any number of digits [0-9] until a semi colon ";" is encountered. The number may span over multiple lines. You can assume the input is valid. Overload the operator+ so that it adds two bigint together. Overload the subscript operator[]. It should return the i-th digit, where i is the 10^i position. So the first...
Do the following problems. 1. Each of three barrels from a manufacturing line are classified as...
Do the following problems. 1. Each of three barrels from a manufacturing line are classified as either above (a) or below (b) the target weight. Provide the ordered sample space. 2. The heat on each of two soldered parts is measured and labeled as either low (l), medium (m), or high (h). State the number of elements in the ordered sample space. 3. Consider the set of Beatles songs with a primary writer as either Paul McCartney (P) or John...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT