Question: programming language Google x Ra Lab 3 - 2020 Spring Term (1 x Dropbox - Submit files x C++ Program to Find All Roc X

programming language

programming language Google x Ra Lab 3 - 2020 Spring Term (1

Google x Ra Lab 3 - 2020 Spring Term (1 x Dropbox - Submit files x C++ Program to Find All Roc X G DB hosted.cuny.edu/webapps/blackboard/execute/content/file?cmd=view&content_id=_443897171&course_id=_1839575_1&fral 17 Lab 3 17 Description: Write a program that will find the sum of the even numbers of 1/ a sequence from the starting point to the end. 77 1. Declare the needed variables 2. Collect the user input (a = first term, b last tern) Note: IF the last term is smaller than the first and!!! // and put out a message informing the user // 3. Find the sum of the odd terms ONLY.. (Use a loop) // 4. Print the sum. // // Note: For example, if a - 1, b - 9 then the sequence is: 2 + 4 + 6 + 8 and the sum - 20 // // // if a - 8, b-10, then the series is 8 + 10 and the sum - 18 // // * #include using namespace std; enter // Header file needed for I/O // Line used for simplicity int main() // 1. Declare the variables needed for this program. // Use a, d, n and sum as integers // You may declare other variables as needed int a, b; int sum - 0; // Must be initialized to zero // 2. Collect the user input needed cout > a; cout > b; // Check if the first term is bigger than then the last // if it is put out the message: "First bigger than last" // otherwise go t step 3. // 3. Once the input is entered, use a loop to find the sum of the EVEN numbers // 4. Print the sum cout

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!