Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

CSC100AA and CIS162AB Ch 2 Program 2 - TwoNumbers Operations Please adhere to the Standards for Programming Assignments and the C++ Coding Guidelines. Submit the

CSC100AA and CIS162AB

Ch 2 Program 2 - TwoNumbers Operations

Please adhere to the Standards for Programming Assignments and the C++ Coding Guidelines.

Submit the following:

List of source code with comments to document

Test output listed as comments at the end of your program

TwoNumbers.cpp (5 pts)

Write a program that does the following:

Declare two integer variables and assign integer values 25 and 75 to the variables. Your code will perform basic arithmetic operations (add, subtract, multiply, and divide) using the two variables declared.


Declare variables to store the sum, difference, product, and quotient of the values.

The sum is the total of the two values.

Subtract the smaller value from the larger value to determine the difference.

Multiply the two values together to determine the product.

Divide the larger value by the smaller value to determine the quotient.

What is the difference between / (divide) and % (modulus)? You can answer this question as a comment in your code.

Your program will display the values assigned to the two integer variables and the results of the arithmetic operations as shown in the sample output below. Test your program by changing the integer values to 125 and 25.

Try it: Do you get the same output if you change the int variables to a double? You can use comments in your code to write your observations.


Sample output:

The values are: 25 and 75

Sum: 100

Difference: 50

Product: 1875

Quotient: 3


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

Essential SQLAlchemy Mapping Python To Databases

Authors: Myers, Jason Myers

2nd Edition

1491916567, 9781491916568

Students also viewed these Databases questions

Question

8.10 Explain several common types of training for special purposes.

Answered: 1 week ago