Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write a python program for the following Write a graphics method: make stripe (n, ch) that returns n consecutive ch characters. (e.g., makeStripe (5, 'X')
Write a python program for the following
Write a "graphics" method: make stripe (n, ch) that returns n consecutive ch characters. (e.g., makeStripe (5, 'X') should return XXXXX) Use this method to write a program that draws triangles. For example, can use these methods to draw one of these patterns: Try and draw your triangles efficiently (i.e., using loops to minimize the number of statements). Handle choices outside 1 to 5; after printing for the size of out the result string. If the number entered for the size of base is even, use the next higher odd number. Here is the precise dialog required: Program to draw triangles. Written by John Koch. Please choose an option: for triangle pointing up; for triangle pointing down; to print the result; to add a blank line; to stop this program; Enter size of base: 11 Enter character used to draw: * Enter number of blanks preceding each line: 0 Please choose an option: for triangle pointing up; for triangle pointing down; to print the result; to add a blank line; to stop this program; Enter size of base: 11 Enter character used to draw:* Enter number of blanks preceding each line: 0 Please choose an option: for triangle pointing up; for triangle pointing down; to print the result; to add a blank line; to stop this program; Enter size of base: 3 Enter character used to draw: * Enter number of blanks preceding each line: 3 The program should be stored in triangles.py. You may run turning for triangles as many times as you want. This program is due at noon on Tuesday, April 18, 2017. This program is worth 90 points Write a "graphics" method: make stripe (n, ch) that returns n consecutive ch characters. (e.g., makeStripe (5, 'X') should return XXXXX) Use this method to write a program that draws triangles. For example, can use these methods to draw one of these patterns: Try and draw your triangles efficiently (i.e., using loops to minimize the number of statements). Handle choices outside 1 to 5; after printing for the size of out the result string. If the number entered for the size of base is even, use the next higher odd number. Here is the precise dialog required: Program to draw triangles. Written by John Koch. Please choose an option: for triangle pointing up; for triangle pointing down; to print the result; to add a blank line; to stop this program; Enter size of base: 11 Enter character used to draw: * Enter number of blanks preceding each line: 0 Please choose an option: for triangle pointing up; for triangle pointing down; to print the result; to add a blank line; to stop this program; Enter size of base: 11 Enter character used to draw:* Enter number of blanks preceding each line: 0 Please choose an option: for triangle pointing up; for triangle pointing down; to print the result; to add a blank line; to stop this program; Enter size of base: 3 Enter character used to draw: * Enter number of blanks preceding each line: 3 The program should be stored in triangles.py. You may run turning for triangles as many times as you want. This program is due at noon on Tuesday, April 18, 2017. This program is worth 90 pointsStep 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