Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In C++ please! Write a program that takes three letters (either capital or lowercase) as input then outputs them in the ascending order based on

In C++ please!

Write a program that takes three letters (either capital or lowercase) as input then outputs them in the ascending order based on their ASCII values. Note that letter 'A' has the smallest ASCII value, followed by 'B', until lowercase 'z'. For example, if the user inputs

a A b 

the program will output

A a b 

Hint: declare three char variables to accept the user input of three letters, then compare these three letters using operator like how you will compare three numbers to determine their output order. Think of three numbers n1, n2, n3, what could be the possible cases (e.g., n1>n2>n3, n1>n3>n2, n2>n1>n3, )?

Any attempt to hard code answers will result in a 0 for the exercise.

image text in transcribed

Write a program that takes three letters (either capital or lowercase) as input then outputs them in the ascending order based on their ASCII values. Note that letter 'A' has the smallest ASCII value, followed by 'B', until lowercase 'z'. For example, if the user inputs a Ab the program will output A a b Hint: declare three char variables to accept the user input of three letters, then compare these three letters using operator like how you will compare three numbers to determine their output order. Think of three numbers ni, n2, n3, what could be the possible cases (e.g., n1>n2>n3, n1>n3>n2, n2>nl>n3, ...)? Any attempt to hard code answers will result in a 0 for the exercise

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

Genetic Databases

Authors: Martin J. Bishop

1st Edition

0121016250, 978-0121016258

More Books

Students also viewed these Databases questions