Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a program that prompts the user to enter two ODD integers between 0 and 100. The program will perform some calculation on them and

image text in transcribed
Write a program that prompts the user to enter two ODD integers between 0 and 100. The program will perform some calculation on them and print out the results. Assumption: Users always enter a number between 0 and 100. You do not need to write the programming logic to check if an input falls within the range. Requirements: No global variables are allowed for this assignment. (ie.. you cannot have variables declared outside main().(-100% if global variables are used). The program accepts two integers as inputs and stores them using variables. The program calculates their sum, difference, product and average and then displays the results. The result of the difference of the two integers must always be a positive number. (Hint is given on next page) The result of the average of the two integers should be displayed with 2 decimal points, e.g.. 4.00; 8.00, etc.) (I have added a small challenge in this assignment) The program will terminate if any of the inputs is not an odd integer (Hint: Some C++ features in Chapter 4 [Decision) should be used. The following excerpt of the program using an "t" statement is given below as a hint. For the programming logic to check if an input is not an ODD integer, you need to do some research and learn how this can be done. if ( logic of checking if input(s) are not ODD integers goes here { cout

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

Database Processing

Authors: David J. Auer David M. Kroenke

13th Edition

B01366W6DS, 978-0133058352

More Books

Students also viewed these Databases questions

Question

=+What forms of industrial action are common?

Answered: 1 week ago