Question: Lab 7 Loop Add Program CSCI 111 Programming and Algorithms I Due Tuesday February 9, 11:59pm on turnin 10 Points NEW CONCEPTS: Successful completion of
Lab 7
Loop Add Program
CSCI 111 Programming and Algorithms I
Due Tuesday February 9, 11:59pm on turnin
10 Points
NEW CONCEPTS: Successful completion of this lab incorporates the following new concepts.
Comments
While loop
Summing data
Remember to add proper deader documentation. Here is an example.
// lab7.cpp
// CSCI 111 Section 4 = Due 02/09/2021
//
// Description: Money program that simulates a transaction with quarter, dimes and nickels
#include
using namespace std;
int main()
{
BLAH. BLAH. BLAH
}
Task list:
1. Create a source code file named lab7.cpp.
2. Prompt the user to enter his/her name, a start value, an increment value, and an end value. Store these values into 4 variables. The name should be of string type and the other 3 of int type.
3. Write a while loop that starts by displaying the start value. Within the loop increment the value based on the increment value. The loop should terminate once the end value is reached.
4. Within the body of the while loop, include an aggregate (i.e. summing) statement that continually adds the values. The total aggregate value is displayed prior to the end of the program.
5. Refer to the expected output listing below.
6. Compile and execute the code. Refer to previous labs for compile/execute command syntax.
7. If you are working on this lab remotely, transfer the lab7.cpp code from jaguar to your laptop.
8. Submit your lab7.cpp file on https://turnin.ecst.csuchico.edu/ and get a successful message
GRADING
To achieve a maximum score, students will need to clearly prove that they completed the goal.
Points lost for incompleteness, sloppiness, lateness, or failure to follow instructions.
Refer to syllabus for late policy.
SAMPLE OUTPUT
/user/faculty/jraigoza/CSCI111/Labs/lab7 $ ./lab7
Enter your name.
Jose
Enter the start value.
4
Enter the increment value.
5
Enter the end value.
29
Greetings Jose, here the numbers:
4
9
14
19
24
29
Thanks for playing Jose. The sum is 99.
/user/faculty/jraigoza/CSCI111/Labs/lab7 $ ./lab7
Enter your name.
Jose
Enter the start value.
9
Enter the increment value.
2
Enter the end value.
20
Greetings Jose, here the numbers:
9
11
13
15
17
19
Thanks for playing Jose. The sum is 84.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
