Question: in c++ Write an interactive program that will allow a user to input only positive integer values and determine the following: 1. The sum of
in c++
Write an interactive program that will allow a user to input only positive integer values and determine the following:
1. The sum of all even numbers between 1 and the number entered.
2. Whether the input is a number divisible by 7 3. The sum of the digits of the input.
Program architecture:
The program should prompt the user to input data and display the results.
The program should prompt the user to enter 'y' to continue to input new data and quit by entering 'n'.
The program should allow the user to enter at a minimum one data input.
The program should use an appropriate loop statement and if statements.
Example output:
if input was not an integer or negative:
invalid input
Do you wish to continue? ('y' or 'n')
if positive integer is in put: example input 14
The sum of all even numbers between 1 and the input is : 56
yes the inout is divisible by 7
The sum of the digits of the input is 5
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
