Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

write a code in c language Suppose you are trying to send a secret number to a friend. This number will be encrypted by means

image text in transcribed

write a code in c language

Suppose you are trying to send a secret number to a friend. This number will be "encrypted by means of converting the number into its corresponding ascii character (ASCII Table). By inspecting the table, you will notice that some characters are not directly printable to the console (namely the first 33 values). Refer to the library to check if the input is in fact one of these characters. Furthermore, your friend may be confused if your integer is encrypted into another integer or a space, so you must avoid any of these. Again, use the library. Your task is as follows: 1. Instantiate a while loop that runs indefinitely until the break command is called (i.e. an infinite loop) 2. Within this loop, collect an integer value between (0-127) as input from the user 3. Check if this integer value fits the following criteria: o Is a number between 0 and 127 o is a printable character o is not a space" "character o Does not map to another integer character ('O-'9') 4. If the input does not fall within 0 and 127, you must break from the loop and quit with a dialog (see example) 5. If the input does not match the other criteria, print a dialog indicating this (see example) 6. If the input is valid, print the corresponding ascii character that maps to the integer input Adhere as closely to the following example: Enter a number to encrypt (0-127): 1 That number is invalid Enter a number to encrypt (0-127): 32 That number is invalid Enter a number to encrypt (0-127): 65 Your encrypted number is: A Enter a number to encrypt (0-127): 35 Your encrypted number is: # Enter a number to encrypt (0-127): 9999 Number is out of range Quitting

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

Database Design Application And Administration

Authors: Michael Mannino, Michael V. Mannino

2nd Edition

0072880678, 9780072880670

More Books

Students also viewed these Databases questions