Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Please help me with this. If you read the question below you will understand how to do it. Write in PYTHON In this last checkpoint,
Please help me with this. If you read the question below you will understand how to do it. Write in PYTHON
In this last checkpoint, you will write a new program that outputs a framed greeting for a person who enters a first and a last name. An example of running this is Please enter your first name: John Please enter your last name: Cleese ************* ** Hello, ** John *** ** Cleese! ** ************* This will take a bit more work than the previous checkpoints. You will need to ask the user for a first name and read it; you will need to ask the user for a last name and read it; you will then have to use these two names to compute the framed greeting. While doing so, you will need to calculate the maximum of the lengths of "Hello,", the first name, and the last name (with the ! added to it). This will help you determine how many '*' to output for the first and last lines. Note that, we will see the function that will help us find maximum value in Lecture 4 (in short, it is called max, e.g. max(1,2)). Go ahead and write and test this. In doing so, your output might look like Please enter your first name: John Please enter your last name: Cleese 2 ************* ** Hello, ** ** John ** ** Cleese! ** ************* Finally, you need to figure out how to get the appropriate number of spaces between the end of each word and the '*'. This is the difference between the length of the string and the maximum of the lengths of three strings. See if you can figure it out. Test your program with different sets of first and last names, including using three different cases: where both names are shorter than Hello,, where the first name is the longest string, and where the last name is longestStep 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