Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please write a C ++ program that will keep accepting 3 integer numbers from the user, and output these 3 numbers in order, the sum,

Please write a C++ program that will keep accepting 3 integer numbers from the user, and output these 3 numbers in order, the sum, and the average of these 3 numbers. You must stop your program when the first number from the user is -777.

Design Specifications and Regulations:

(1) You must use your full name on your Welcome and Thank-you messages.

(2) You must define all the following 5 functions in your program with no exception:

def max (p, q, r) # return the maximum of these 3 integer parameters

def min (p ,q , r) # return the minimum of these 3 integer parameters

def mid (p, q, r) # return the middle of these 3 integer parameters

def sum (p, q, r) # return the sum of these 3 integer parameters

def avg (p, q, r) # return the average of these 3 integer parameters

(3) You must NOT use any existing Python functions in your program.

(4) You must NOT sort those 3 numbers in order to print them in order. You must print them in order by printing minimum, middle, and then maximum.

(5) You must fully test your program to make sure these 5 functions are working perfectly for any data.

test case is as follows:

Welcome to the program of "firstname lastname"!

Enter first number: 9

Enter second number: 7

Enter third number: 5

You just entered 3 integers: 9 7 5

These 3 integers in order are 5 7 9

Their sum is 21 and their average is 7.0

Enter first number: 6

Enter second number: 8

Enter third number: 10

You just entered 3 integers: 6 8 10

These 3 integers in order are 6 8 10

Their sum is 24 and their average is 8.0

Enter first number: 9

Enter second number: 1

Enter third number: 8

You just entered 3 integers: 9 1 8

These 3 integers in order are 1 8 9

Their sum is 18 and their average is 6.0

Enter first number: 7

Enter second number: 7

Enter third number: 7

You just entered 3 integers: 7 7 7

These 3 integers in order are 7 7 7

Their sum is 21 and their average is 7.0

Enter first number: 8

Enter second number: 2

Enter third number: 2

You just entered 3 integers: 8 2 2

These 3 integers in order are 2 2 8

Their sum is 20 and their average is 4.0

Enter first number: 8

Enter second number: 8

Enter third number: 2

You just entered 3 integers: 8 8 2

These 3 integers in order are 2 8 8

Their sum is 24 and their average is 6.0

Enter first number: -6

Enter second number: -3

Enter third number: -9

You just entered 3 integers: -6 -3 -9

These 3 integers in order are -9 -6 -3

Their sum is -18 and their average is -6.0

Enter first number: -777

Enter second number: 0

Enter third number: 0

Thank you for playing this program by "firstname lastname"

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

Larry Ellison Database Genius Of Oracle

Authors: Craig Peters

1st Edition

0766019748, 978-0766019744

More Books

Students also viewed these Databases questions

Question

Describe your ideal working day.

Answered: 1 week ago