Concept explainers
The programmer intended the following pseudocode to get five sets of two numbers each, calculate the sum of each set, and calculate the sum of all the numbers entered. It will not function as intended, however. Find the error.
// This
Declare Integer number, sum, total
Declare Integer sets, numbers
Constant Integer MAX_SETS = 5
Constant Integer MAX_NUMBERS = 2
Set sum = 0;
Set total = 0;
For sets = 1 To MAX_NUMBERS
For numbers = 1 To MAX_SETS
Display "Enter number ", numbers, " of set ", sets, "."
Input number ;
Set sum = sum + number
End For
Display "The sum of set " sets, " is , sum, "."
Set total = total + sum
Set sum = 0
End For
Display "The total of all the sets is total , "."
Want to see the full answer?
Check out a sample textbook solutionChapter 5 Solutions
Starting Out with Programming Logic and Design (5th Edition) (What's New in Computer Science)
Additional Engineering Textbook Solutions
Objects First with Java: A Practical Introduction Using BlueJ (6th Edition)
Concepts of Programming Languages (11th Edition)
Starting Out With Visual Basic (7th Edition)
Database Concepts (8th Edition)
Computer Science: An Overview (13th Edition) (What's New in Computer Science)
- UNIVERS UNIVER GE AL-FARABI UNIVERSITY COLL GE Homework 3: Write a program to calculate two real numbers. The operation you are going to used are "add, subtract, multiple and division" and it is going to be optional to calculate the two numbers separately at each time you are going to execute the program. After you execute the program separately at each time your run the program the output look like below: Enter Enter + to add between two nunbers - to subtract betveen tuo nunbers to nultiply between tvo nunbers to divide betueen tuo nunbers Enter Enter Enter the o peration :+ Enter the ist nunber :2.3 Enter the 2nd nunber :5.6 The result is 7.980 Press any key to continue. . .- OR to add betueen two nunbers to subtract between two nunbers * to nultiply betveen two nunbers / to divide between two nunbers Enter Enter Enter Enter Enter the operation :- Enter the 1st nunber :2.3 Enter the 2nd nunber :5.6 The result is -3.300 Press any key to continue ...- Al-Farabi University College…arrow_forwardRefer to the following code. Which line may be used to complete the code so it would not result to an error? count = 15 while count > 5: print (count) A none of these; the code is complete by itself (B) count == count (C) count = count - 4 (D) count += 1arrow_forwardWrite MARIE assembly language code to implement the following algorithm:arrow_forward
- This is under C programming not C++ please include screenshot of the program and the compiler. Sample output is provided below. Ask the user to input an n number of arrays and the program should be able to do the following functions:a) Find an average of an input arrayb) Find the highest value from the input arrayc) Search for a particular number from the input array (should give the indexorindices if there are more than 1)arrow_forwardAC that adds two very large integers entered by the user on the keyboard write the program. Very large integers represent standard data types (long int, double, etc.) you cannot collect it using. Reading and adding numbers from the keyboard as a string As you learned the process in elementary school, starting from the units digit, you can add the mutual numbers one by one. you must realize by collecting. The numbers that the user has entered into a different number of digits. In order to have it, your program should work. The output of your program is the example below should be compatible with the program outputs. In the program output, as in the addition operation the numbers and the total should be written one under the other, with the mutual digits aligned. Sample program output - 1: First number: 111111111111111111111111 Second number: 999999999 11111111111u111. 9999999999 1111111111111120000000000 Sample program output - 2: First number: 11 Second number:…arrow_forwarddligitalworld.weebly.com oad this PDF 1 of 1 CRIBD MIllions of books, audiobooks, magazines, documents, sheet music, and more for free. : Write a pseudocode algorithm to prompt the user to enter the current year and the year a person was born. Calculate and print the age of the person. The algorithm should also determine and print the status of the person based on their age. Use the following table as a reference: Age (Vears) Status Infant Baby 13-18 Teengaer 19-59 Adaie Lin and over 28°C Mostly cloudyarrow_forward
- Fibonacci sequence: The first two numbers of the fibonacci sequence are 1 and 1, and sequential numbers are the sum of the previous two. Write a program that prompts the user for an integer n and then prints the first n numbers of the Fibonacci sequence (Please type answer no write by hend)arrow_forwardFind the error in the following pseudocode. Declare Real pi Set 3.14159265 = pi Display "The value of pi is ", piarrow_forwardPseudocode: What is the output of the code corresponding to the following pseudocode? Set M = 2 Repeat Set P = 1 while P < 4 print M + " and " Set P = P + 1 End While (P) Set M = M + 1 Until M = 3 O 2 and 1 2 and 2 2 and 3 3 and 1 3 and 2 3 and 3 O None of these choices OM and P M and P M and P O1 and 1 2 and 2 3 and 3 O 2 and 1 | 3 and 1arrow_forward
- This standard library function returns a random floating-point number within a specified range of values.a. randomb. randintc. random_integerd. uniformarrow_forward1: You are given a list of students’ names and their test scores. Design algorithm that does thefollowing:a. Calculate the average test scores.b. Determines and prints the names of all the students whose test scores are below theaverage test score.c. Determines the highest test score.d. Prints the names of all the students whose test scores are the Same as the highest testscore.arrow_forwardProgram by using C # C sharp My student number :1910206534arrow_forward
- C++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage LearningC++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology PtrMicrosoft Visual C#Computer ScienceISBN:9781337102100Author:Joyce, Farrell.Publisher:Cengage Learning,
- Programming Logic & Design ComprehensiveComputer ScienceISBN:9781337669405Author:FARRELLPublisher:Cengage