Question: Write a program that can add up to 4 numbers together, giving a sum of the values. If the player enters 0, or a number

 Write a program that can add up to 4 numbers together,

Write a program that can add up to 4 numbers together, giving a sum of the values. If the player enters 0, or a number higher than 4, the program gives an error message and ends without producing any further input. When the program begins, it will tell you what its purpose is, and then ask you how many numbers you would like to enter for addition. Upon choosing that value, the computer will prompt you for input that many times. At the end, it will give you the total. No error- checking for invalid inputs is required. This program adds 1-4 numbers together. How many numbers do you want to add? Enter number 1: 2 Enter number 2: 2 Enter number 3: 3 Your total is: 7

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!