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:

  1. Read in a message from the user.
  2. If the message is less than 20 characters long, invoke the one-parameter trianglePrint method.
  3. If the message is 20 characters or longer:
    1. Ask the user to choose an interval that is at most half the length of the message.
    2. Use a loop to continue to read in an interval until you get a valid value.
    3. Invoke the two-parameter trianglePrint method.

Step by Step Solution

3.32 Rating (152 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

def main message inputEnter a message if lenmessage 20 trianglePrintmessage else while True try inte... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!