Question: Write a complete program to output a right-triangle print version of a user's message. The program will have three methods: a main method and two
Write a complete program to output a "right-triangle print" version of a user's message.
The program will have three methods: a main method and two overloaded versions of a trianglePrint method.
main Method Specifications
In main, the program will accomplish the following tasks:
- Read in a message from the user.
- If the message is less than 20 characters long, invoke the one-parameter trianglePrint method.
- If the message is 20 characters or longer:
- Ask the user to choose an interval that is at most half the length of the message.
- Use a loop to continue to read in an interval until you get a valid value.
- Invoke the two-parameter trianglePrint method.
Step by Step Solution
3.32 Rating (152 Votes )
There are 3 Steps involved in it
def main message inputEnter a message if lenmessage 20 trianglePrintmessage else while True try inte... View full answer
Get step-by-step solutions from verified subject matter experts
