Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a program that asks user to enter 3 letters of the alphabet in any order. It then prints out those three letters in alphabetical

Write a program that asks user to enter 3 letters of the alphabet in any order. It then prints out those three letters in alphabetical order.

descriptipn: 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 or k

r

d

should all result in a program output of dr.

the program should use variables of type char. Note that char variables are stored in memory by their ASCII code. 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).

image text in transcribed
and this is the code i wrote.. which isnt running! can you please show me an alternative way to do it whilst providing what i missed in my code to solve it as well?
image text in transcribed
image text in transcribed
The cout statement that produces the first line in the output displayed above is given in the starter code. DO NOT CHANGE THIS COUT STATEMENTI You will need to add another cout statement to display the sorted letters (no spaces). covtcebiggestecanaliesteenediuncendli, coo v1=00Y117137 trumeb73080 15k bashi ki oommand not foend ../reporee/meripts/run, ehy line if Aasiqnent3, exel command not found

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 Database Programming With Visual C# .NET

Authors: Ying Bai

1st Edition

0470467274, 978-0470467275

More Books

Students also viewed these Databases questions

Question

Did you organize your thoughts and make a Table of Contents?

Answered: 1 week ago