Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I have no clue how to start or even approach this. Any help would be appreciated. Looping Lab Assignment The assignment contains two parts 1.

image text in transcribed

I have no clue how to start or even approach this. Any help would be appreciated.

Looping Lab Assignment The assignment contains two parts 1. Positive sum. Study hovering. As you work on this project, demonstrate to the lab instructor looking up the value of a variable by hovering over it. Create a project titled Lab3_Sum with a single file sum.cpp. Your program should ask the user for a sequence of numbers until the user inputs o (zero) and then the program should print the sum of positive numbers that the user input. Here is an example dialog: -4 3-20 10 45 -100 1 0 Input sequence of integers (zero to stop): The sum of positive numbers is: 59 You are not allowed to use functions, arrays or other constructs that we have not yet studied. Hint: You need to use iterate-and-keep-track idiom. while or do-while would be a good construct to use. Consider a single number in each iteration. In the while-expression check if this number is not zero. If not -- proceed, if yes -- stop evaluation and print out the result. Declare a variable where your program will collect the sum of positive numbers. Make sure to initialize this variable. In the loop, with an if, check if the number is positive and, if yes, add it to the sum. Look at this example of selecting the maximum number. It is very similar to what you need to implement

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

C++ Database Development

Authors: Al Stevens

1st Edition

1558283579, 978-1558283572

More Books

Students also viewed these Databases questions