use C++ In this program you will be outputting the characters that map to the ASCII codes 32 through 126. You will need a loop to iterate through the input values and output the corresponding character. This mapping is shown in appendix A in your Gaddis text book. Your program will be reading in two unsigned integer values. The prompt for read will be: Enter lower and upper values You need to check that both values are in the range of 32 to 126. If the values are less than 32 or greater than 126 you need to display the message: Values must be in range 32 to 126 inclusive You will also display the above message if the first value read in is larger than the second value. If the values are invalid you need to reread the values with the prompt. Enter lower and upper values You need to keep reading in values, checking if they are valid and displaying an error message until the values read in are valid. You can use a while or do while loop to do this. Once you have valid input values you need to display the values as characters with 20 characters per line of output. To output an integer value as a character you must either store the integer value in a char, unsigned char, or you need to cast the integer value to a char, or unsigned char. The first and last lines of output need to be: ----+----+----+----+ Note that each of the + characters represents a column that is a multiple of 5. So for input values of: 32 126 We would get the output: Enter lower and upper values Characters for ASCII values between 32 and 126 ----+----+----+----+ !"#$%&'()*+,-./0123 456789:;<=>?@ABCDEFG HIJKLMNOPQRSTUVWXYZ[ \]^_`abcdefghijklmno pqrstuvwxyz{|}~ ----+----+----+----+ In the above output the value of 32 maps to the character ' ', 33 prints out as '!', and so on until we get to 126 that maps to '~'. Also see Appendix A in the Gaddis text book for the ASCII character mappings. Here is a second run with some invalid input values: 31 126 32 127 32 52 We get the following output: Enter lower and upper values Values must be in range 32 to 126 inclusive Enter lower and upper values Values must be in range 32 to 126 inclusive Enter lower and upper values Characters for ASCII values between 32 and 52 ----+----+----+----+ !"#$%&'()*+,-./0123 4 ----+----+----+----+

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

use C++

In this program you will be outputting the characters that map to the ASCII codes 32 through 126. You will need a loop to iterate through the input values and output the corresponding character. This mapping is shown in appendix A in your Gaddis text book.

Your program will be reading in two unsigned integer values.

The prompt for read will be:

Enter lower and upper values

You need to check that both values are in the range of 32 to 126. If the values are less than 32 or greater than 126 you need to display the message:

Values must be in range 32 to 126 inclusive

You will also display the above message if the first value read in is larger than the second value.

If the values are invalid you need to reread the values with the prompt.

Enter lower and upper values

You need to keep reading in values, checking if they are valid and displaying an error message until the values read in are valid. You can use a while or do while loop to do this.

Once you have valid input values you need to display the values as characters with 20 characters per line of output. To output an integer value as a character you must either store the integer value in a char, unsigned char, or you need to cast the integer value to a char, or unsigned char.

The first and last lines of output need to be:

----+----+----+----+

Note that each of the + characters represents a column that is a multiple of 5.

So for input values of:

32 126

We would get the output:

Enter lower and upper values Characters for ASCII values between 32 and 126 ----+----+----+----+ !"#$%&'()*+,-./0123 456789:;<=>?@ABCDEFG HIJKLMNOPQRSTUVWXYZ[ \]^_`abcdefghijklmno pqrstuvwxyz{|}~ ----+----+----+----+

In the above output the value of 32 maps to the character ' ', 33 prints out as '!', and so on until we get to 126 that maps to '~'. Also see Appendix A in the Gaddis text book for the ASCII character mappings.

Here is a second run with some invalid input values:

31 126 32 127 32 52

We get the following output:

Enter lower and upper values Values must be in range 32 to 126 inclusive Enter lower and upper values Values must be in range 32 to 126 inclusive Enter lower and upper values Characters for ASCII values between 32 and 52 ----+----+----+----+ !"#$%&'()*+,-./0123 4 ----+----+----+----+

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 2 images

Blurred answer
Knowledge Booster
Algebraic Expressions
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education