
Concept explainers
Write a flowgorithm
tasks:
The outside loop asks if the user is going to enter numbers to sum
The inside loop should:
o ask for input of a positive or negative number
o input of zero (0) will terminate the input loop and display the sum of
the input numbers
The outside loop, will ask if a new set of numbers will be will input or
should the program stop.
If a different set of numbers is input a new sum should be calculated and
displayed.
The program continues to run until stopped via the outside loop.
Remember the following:
use clear prompts for your input
label each output number or name
use comment box for your name, lab name and date at the top of the
flowgorithm
use other comments where appropriate
use appropriate constants

Trending nowThis is a popular solution!
Step by stepSolved in 3 steps

- Write a program that receives a series of numbers from the user and allows the user to press the enter key to indicate that he or she is finished providing inputs. After the user presses the enter key, the program should print the sum and average of the numbers. Use while loop and if statements for this question.Please submit pseudocode, flow chart and screenshot of the output.arrow_forwardMake sure that the user enters a number between 1 and 20, otherwise print an error message and prompt for another number. Exit the program if the user enters 0. For example, if the user enters the number 5, the output would be: ** *** **** C++ programming ***** **** *** ** * Use 3 nested loops; 1. the outside loop should prompt for the size of the triangle, then print the triangle for that size and loop back for another triangle's size. (If the user enters O, then exit the program). 2. the middle loop should print each row in a triangle, one row per each iteration. 3. the inside loop should print the asterisks in each row, one iteration per asterisk. Test your program with several different sized triangles. Once you're satisfied that it works, run your program to capture the output of your program when using sizes 4, 5, 8, and 0 (the sentinel). Submit program file(s) and print screens or snips showing the output.arrow_forward3. Out of the given loops, which loop/s will execute infinitely. a. for(; true; ) b. for(; false;) c. for(; 2==2; )arrow_forward
- Abang Mat will give 10% discount to customers who buy more than 100 pieces of satay. The program will: • read the type of satay that the customer would like to buy • print the bill for each customer based on the quantity and discounts. loop to read and process the purchasing information of FIVE (5) customers. You may assume that the users will always key in a correct input, hence Input validation is not needed. A sample output is shown in Figure 1: Welcome to Kedai Sate Abang Mat You are customer number 0:What would you like to order? 1. Satay Ayam 2.Satay Kambing Enter your option:1 Quantity: 12 Bill RM 12.00 Type of Satay Chicken Lamb Quantity: 36 Bill RM 54.00 Price (per stick) RM1.00 RM1.50 Welcome to Kedai Sate Abang Mat You are customer number 1:What would you like to order? 1. Satay Ayam 2.Satay Kambing Enter your option:2 ******* Welcome to Kedai Sate Abang Mat You are customer number 4: What would you like to order? 1. Satay Ayam 2.Satay Kambing Enter your option:1 Quantity:…arrow_forwardCalculating the Factorial of a Number (n!) The formula for the factorial of a number is: 7! = 1 x 2 x 3 x 4 x 5 x 6 x 7 = 5040 4! = 1 x 2 x 3 x 4 = 24 Write a Flowgorithm program that: 1 - utilizes nested loops to calculate the factorial of a number2 - prompts the user for input of a positive integer3 - utilizes a loop to calculate the factorial of that number4 - displays clearly labeled results5 - asks the user if he or she wishes to run the program againarrow_forwardA loop should output 1 to n. If n is 5, the output is 12345. What should XXXand YYY be? Choices are in the form XXX / YYY.arrow_forward
- Can this be completed using a while loop at least once or twicearrow_forwardWrite a Flowgorithm program that: 1 - utilizes nested loops to calculate the factorial of a number2 - prompts the user for input of a positive integer3 - utilizes a loop to calculate the factorial of that number4 - displays clearly labeled results5 - asks user if he or she wish to run the program againarrow_forwardWrite a flowchart and C code for a program that does the following: Assign the passcode 11862 to a variable Ask a user to enter a passcode Use a while loop to allow the user three tries Use if...else statements to check to see if the user entry matches the password (Hint: Use the equal operator ==) If the user enters the password correctly use a break or assign the looping condition a value so the loop stops Display a message if the user enters the passcode correctly. Display 'Try Again' if the user enters the passcode incorrectlyarrow_forward
- Write a pseudocode and flowchart and add in a while loop and a do- while loop(can be any scenario related to the question) for a store that wants to ask a user to enter daily sales, calculate weekly total and display the results. declare all variables and use proper indentation.arrow_forwardUsing for loop, write a program that accepts an integer from the user between 100 and 1000 andchecks if it is divisible by 2, 3, 4, 5, 6, 7, 8, 9 and accordingly displays a message to the userarrow_forward
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education





