Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ Problem Statement Write a program that - First, asks the user to choose whether sorting order is in increasing order ('I' or 'i') or

C++ image text in transcribed
image text in transcribed
image text in transcribed
Problem Statement Write a program that - First, asks the user to choose whether sorting order is in increasing order ('I' or 'i') or decreasing order ('D' or ' d '); if the user inputs other character, quit the program directly. - Second, reads three integer numbers and sorts these three numbers in the order according to the choice from first step. - Last, reports that three numbers are in lenient or strict increasing/decreasing order. Only when three numbers are all different, the ordering is in strict, otherwise it is a lenient ordering. Note that when three numbers are all the same, it is lenient, but it can be lenient increasing or lenient decreasing depending on the choice from first step. (For this Lab assignment, you are not allowed to use any sorting algorithms or sort() function yet, for the purpose of practicing conditional statement) Sample output 3: Your wish is my command! I will sort three numbers under your wish: Enter I for increasing ordering, D for decreasing order (I or D): it Please enter three integer numbers: 553 Numbers are sorted in increasing order: 3>55 Numbers are in leniently increasing order! Sample output 4: Your wish is my command! I will sort three numbers under your wish: Enter I for increasing ordering, D for decreasing order (I or D): IA Please enter three integer numbers: 5748324 Numbers are sorted in increasing order: 32>48>57 Numbers are in strictly increasing order! Sample output 5: Your wish is my command! I will sort three numbers under your wish: Enter I for increasing ordering, D for decreasing order (I or D): it Please enter three integer numbers: 332478 Numbers are sorted in increasing order: 2433778 Numbers are in strictly increasing order! Sample output 6: Your wish is my command! I will sort three numbers under your wish: Enter I for increasing ordering, D for decreasing order (I or D): it Please enter three integer numbers: 335733 Numbers are sorted in increasing order: 33>3357 Numbers are in leniently increasing order! Sample output 7: Your wish is my command! I will sort three numbers under your wish: Enter I for increasing ordering, D for decreasing order (I or D): I Please enter three integer numbers: 994545 Numbers are sorted in increasing order: 454599 Numbers are in leniently increasing order! Sample output 8 : Your wish is my command! I will sort three numbers under your wish: Enter I for increasing ordering, D for decreasing order (I or D) : it Please enter three integer numbers: 34451574 Numbers are sorted in increasing order: 3445157 Numbers are in strictly increasing order! Sample output 9: Your wish is my command! I will sort three numbers under your wish: Enter I for increasing ordering, D for decreasing order (I or D) : ie Please enter three integer numbers: 3490674 Numbers are sorted in increasing order: 34m67m90 Numbers are in strictly increasing order! Sample output 10: Your wish is my command! I will sort three numbers under your wish: Enter I for increasing ordering, D for decreasing order (I or D): I Please enter three integer numbers: 254874 Numbers are sorted in increasing order: 72548 Numbers are in strictly increasing order! Sample output 11: Your wish is my command! I will sort three numbers under your wish: Enter I for increasing ordering, D for decreasing order (I

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

Practical Azure SQL Database For Modern Developers Building Applications In The Microsoft Cloud

Authors: Davide Mauri, Silvano Coriani, Anna Hoffma, Sanjay Mishra, Jovan Popovic

1st Edition

1484263693, 978-1484263693

More Books

Students also viewed these Databases questions