Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please make your program simple so that an idiot can understand it. Below is what I'm working with. . . no idea how to add

image text in transcribedimage text in transcribedimage text in transcribed

Please make your program simple so that an idiot can understand it. Below is what I'm working with. . . no idea how to add the Capitalization prioritization either.image text in transcribed

image text in transcribed

Program Objective Write a program that asks the user to enter three letters of the alphabet in any order. It then prints out those three letters in alphabetical order. Program Specifications Your program must ask the user to enter three letters of the alphabet (lowercase or uppercase) in any order. The user must be able to enter the three letters one right after the next, or with whitespace between each, or with each letter on a newline (i.e. enter/return after each letter). The program must then print out those three letters in alphabetical order on a new line. For example, user entries of krd or k r d ork r d should all result in a program output of dkr. Your program should use variables of type char. Note that char variables are stored in memory by their ASCII code (see slides 8-9 of Lecture 5). Since the numerical order of the ASCII codes is equivalent to the alphabetical order of the characters represented by these ASCII codes, alphabetical order can be determined by simply comparing the letters entered as if they were numbers. For the purpose of this assignment, assume that uppercase letters come before lowercase letters. For example: abc should result in Bac bBA should result in ABb Your program must interact with the user and produce output exactly as follows (note the spaces and spelling). The example below shows program output if the user enters pfr. Enter any three letters from the alphabet in any order. PER Rfp Make sure you comment your program like the example program on the last slide of Lecture 2. Algorithm Hints What your program needs to do is sort the three characters entered. But because only three things are being sorted, don't implement some complicated sorting algorithm (don't even use the bubble sort algorithm you learned in Lab 1 - that is best implemented with loops). Instead use nested if-else structures to figure out the alphabetical order of the three characters. There are a few different ways to do this but here is some partial pseudocode to get you started. if the first character is less than the second character and the third character print out the first character if the second character is less than the third character print out the second character and then the third character else print out the third character and then the second character Remember that the user may enter the same letter more than once. Your program MUST be able to handle this scenario. As always, you will be more efficient if you design the logic of your program with a flowchart or pseudocode before you start coding. Pleasemakeyour programsimplesothatanidiotcanunderstandit.BelowiswhatI'mworkingwith...noideahowtoaddtheCapitalizationprioritizationeither. #include #include using namespace std; int main() { char smallest, medium, biggest; cout > smallest; cin >> medium; cin >> biggest; // scenario where smallest is entered first if (largest >= smallest && biggest >= medium) { cout = medium && smallest

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

DB2 11 The Database For Big Data And Analytics

Authors: Cristian Molaro, Surekha Parekh, Terry Purcell, Julian Stuhler

1st Edition

ISBN: 1583473858, 978-1583473856

More Books

Students also viewed these Databases questions

Question

Describe and compute a t test.

Answered: 1 week ago

Question

Azure Analytics is a suite made up of which three tools?

Answered: 1 week ago

Question

1. What are the major sources of stress in your life?

Answered: 1 week ago

Question

What tools might be helpful?

Answered: 1 week ago