Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

programming language Google x CW 3 - 2020 Spring Term (1 x 4 Dropbox - Submit files X C++ Program to Find All Rocx bhosted.cuny.edu/webapps/blackboard/execute/content/file?cmd=view&content_id=_44272181_1&course_id=_183957

programming language

image text in transcribed

Google x CW 3 - 2020 Spring Term (1 x 4 Dropbox - Submit files X C++ Program to Find All Rocx bhosted.cuny.edu/webapps/blackboard/execute/content/file?cmd=view&content_id=_44272181_1&course_id=_183957 1/ CLASS WORK - W3 Label it CW-3.cpp // Description: Write a program that will find the sum from A to B when the user enters both A and B. 17 1/ 1. Declare the needed variables // 2. Collect the user input 1/ 3. Determine if the inputs are valid: A - B 11 4. For correct values of A and B, output the sum. // #include using namespace std; // Header file needed for I/O // Line used for simplicity int main() 17 1. Declare the variables needed for this program. enter 17 2. Collect the user input needed for these two variables // 3. Check if he values are correct. A must be greater or equal to B otherwise exit the program. This requires an IT STATEMENT // 4. If the values are ok compute the sum. / // Extra PPTIONAL - Extra Credit) // On a separate .cpp file, label it CW3-extra.cpp // Write a program to compute the factorial of a number. // Recal that n! - n(n-1)(n-2)(n-3)...(2) (1) // Ex: 4! - (4) (3) (2) (1) - 24 // // 1. Let the user input a number n. // 2. If the number is not positive exit the program 113. For valid values of n, compute n! 14. Output a final message with the value of nl 11----- return 0

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

Step: 3

blur-text-image

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

Beginning C# 5.0 Databases

Authors: Vidya Vrat Agarwal

2nd Edition

1430242604, 978-1430242604

More Books

Students also viewed these Databases questions

Question

1. Identify three approaches to culture.

Answered: 1 week ago

Question

2. Define communication.

Answered: 1 week ago

Question

4. Describe how cultural values influence communication.

Answered: 1 week ago