Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Arithmetic Overview For this daily, write a C + + program that will perform simple arithmetic with two integer values and display the results. A

Arithmetic
Overview
For this daily, write a C++ program that will perform simple arithmetic with two integer values and display the
results.
A CPP file (arithmetic.cpp) has been provided. It contains the declaration for two integers (num1 and num2).
Add code that will calculate:
first number + second number
first number - second number
first number * second number
first number / second number
first number % second number
second number - first number
second number / first number
second number % first number
Display the results of the calculations in the format:
first_number operator second_number = result
There should be one space after each portion of the display, except the result, which should be followed by a
newline character. Also make sure there is a blank line before the results that start with the second number.
The display of the results should start and end with a newline character.
DO NOT change any of the code that is provided in int main().
File You Must Submit
Add the required code to the source file named arithmetic.cpp
Output
The output produced by the program will vary based on the values entered when it is executed. The output that
is shown below is what the program will produce when it is run in an environment such as Dev C++ or XCode.
When it is run through the Auto Grader, the portions that ask for the integer values WILL NOT show the value
that is entered.
This is used to produce the output for diff 1 :
First number? 12
Second number? 29
12+29=41
12-29=-17
12**29=348
1229=0
1229=12
29-12=17
2912=2
2912=5
This is used to produce the output for diff 2:
First number? -32
Second number? 17
-32+17=-15
-32-17=-49
-32**17=-544
-3217=-1
-3217=-15
17--32=4917?-
32=0
17-32=17
image text in transcribed

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

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2010 Barcelona Spain September 2010 Proceedings Part 2 Lnai 6322

Authors: Jose L. Balcazar ,Francesco Bonchi ,Aristides Gionis ,Michele Sebag

2010th Edition

364215882X, 978-3642158827

More Books

Students also viewed these Databases questions