Question
(1) Prompt the user to enter if he/she wants to code or decode a message. The user should enter C to code and D to
(1) Prompt the user to enter if he/she wants to code or decode a message. The user should enter C to code and D to decode. If the user entered C or c, prompt the user for a message to code. If the user entered D or d, prompt the user for a message to decode. If input starts with c output starts with Enter C to code or D to decode: Enter a message to code: If input starts with C output starts with Enter C to code or D to decode: Enter a message to code: If input starts with d output starts with Enter C to code or D to decode: Enter a message to decode: If input starts with D output starts with Enter C to code or D to decode: Enter a message to decode: (2) If the user has entered c or C, output the coded message. The message is coded as indicated in the introduction of this exercise. Hint: you need to use the functions ord() and chr(). See section 2.9 If input is c Hello! the output will end with: Nkrru' If input is C This is a message. the output will end with: Znoy&oy&g&skyygmk4 (3) If the user has entered d or D, output the decoded message. If input is d Nkrru' the output will end with: Hello! If input is D Vxumxgssotm&oy&l{t4 the output will end with: Programming is fun.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started