Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

2 . 1 T M Write your own functions - Letter App In your tutorial class design and write a program which reads in a

2.1 T M Write your own functions - Letter App
In your tutorial class design and write a program which reads in a name, address and message to be sent as a letter to the recipient.
Based on the description below write pseudocode for the program. Upload the pseudocode to the Ed workspace. NB Make sure your pseudocode is decomposed modularly.
As a class group produce a structure chart for the program. Upload a photo or drawing of the structure chart to the Ed workspace.
Write the code and test it in Ed.
Annotate the code with comments explaining how to use each module (function/procedure) and what they do (not how they work).
The program should work as described below
Description of the program
Create a main() that calls three functions as follows:
1. Returns the label for the letter.
The label should include the title, first name, last name, and street address for the letter. It should be formatted to appear as it would on the front of a sent letter.
2. Returns the message to be send.
Your main() should also call a function which returns the contents of the letter. The contents should consist of simply a subject line and then after a blank line the content of the message. The message should have a line that starts: "RE:" then the subject (read from the user) then a blank line, followed by the message.
3. Prints the label and the message.
Call a procedure that takes the label and the message and prints it to the terminal.
All values except the postcode should be read as strings, the postcode should be an integer between 0 and 9999.
Example output:

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_2

Step: 3

blur-text-image_3

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

Essential SQLAlchemy Mapping Python To Databases

Authors: Myers, Jason Myers

2nd Edition

1491916567, 9781491916568

More Books

Students also viewed these Databases questions

Question

2 What supply is and what affects it.

Answered: 1 week ago

Question

3 How supply and demand together determine market equilibrium.

Answered: 1 week ago