Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C Programming Create a function called printCipher() with a return type of void which takes an int and a _ Bool as parameters. Your function

C Programming

Create a function called printCipher() with a return type of void which takes an int and a _Bool as parameters. Your function declaration should look like:

 void printCipher(int, _Bool); 

Use a loop to display the alphabet in the proper case (the _Bool parameter). The _Bool parameter is set to 1 (true) to display lowercase letters and 0 (false) to display uppercase letters. On the next line, use a loop to display the shifted alphabet in the proper case. To perform the shift, add the shift value to the character (the int parameter). Example with a shift value of 3: A + 3 is D. The shift value can also be negative, shifting the other direction. Example with a shift value of -3: A - 3 is X. Be careful with characters at the beginning or end of the alphabet that wrap around. Note: you will need to support numbers larger than 25 (and smaller than -25).

Calling printCipher(3, 1) produces the output (shift 3, lower case):

abcdefghijklmnopqrstuvwxyz

defghijklmnopqrstuvwxyzabc

Calling printCipher(5, 0) produces the output (shift 5, upper case):

ABCDEFGHIJKLMNOPQRSTUVWXYZ

FGHIJKLMNOPQRSTUVWXYZABCDE

Calling printCipher(29, 1) produces the output (shift 29, lower case):

abcdefghijklmnopqrstuvwxyz

defghijklmnopqrstuvwxyzabc

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

101 Database Exercises Text Workbook

Authors: McGraw-Hill

2nd Edition

0028007484, 978-0028007489

Students also viewed these Databases questions

Question

4. Give recommendations:

Answered: 1 week ago