Write a program that can create four different patterns of different sizes. The number of columns...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Write a program that can create four different patterns of different sizes. The number of columns or row determines the size of each pattern. For example, a pattern of size five has 5 columns and 5 rows. Each pattern is made of character $ and a digit, which shows the size. The size must be between 2 and 9. The following shows the patterns of size 5 Pattern One 5$$$$ $5$$$ $$5$$ $$$5$ $$$$5 . Pattern Two $$$$5 $$$5$ $$5$$ $5$$$ 5$$$$ Pattern Three $$$$$ $$$$5 $$$55 $$555 $5555 Make sure NOT to hard code any number for the pattern. Let the user decide a size between 2 and 9 CODE: The program specifications are: Use a function for user input: Pattern Four $$$$$ 5$$$$ 55$$$ 555$$ 5555$ The function should display a menu and ask the user to choose a pattern and size. Prompt user to choose an option only between 1 and 5, and a pattern size only between 2 and 9. Error check user input( you can use while loop) for numbers OUT of range Loop until user wishes to quit. (You may use do-while loop) Print a menu and echo user's response Make sure to provide four individual functions for displaying each of the four patterns. Write a program that can create four different patterns of different sizes. The number of columns or row determines the size of each pattern. For example, a pattern of size five has 5 columns and 5 rows. Each pattern is made of character $ and a digit, which shows the size. The size must be between 2 and 9. The following shows the patterns of size 5 Pattern One 5$$$$ $5$$$ $$5$$ $$$5$ $$$$5 . Pattern Two $$$$5 $$$5$ $$5$$ $5$$$ 5$$$$ Pattern Three $$$$$ $$$$5 $$$55 $$555 $5555 Make sure NOT to hard code any number for the pattern. Let the user decide a size between 2 and 9 CODE: The program specifications are: Use a function for user input: Pattern Four $$$$$ 5$$$$ 55$$$ 555$$ 5555$ The function should display a menu and ask the user to choose a pattern and size. Prompt user to choose an option only between 1 and 5, and a pattern size only between 2 and 9. Error check user input( you can use while loop) for numbers OUT of range Loop until user wishes to quit. (You may use do-while loop) Print a menu and echo user's response Make sure to provide four individual functions for displaying each of the four patterns.
Expert Answer:
Answer rating: 100% (QA)
The simple Python program that fulfills the specificatio... View the full answer
Related Book For
Practicing Statistics Guided Investigations For The Second Course
ISBN: 9780321586018
1st Edition
Authors: Shonda Kuiper, Jeff Sklar
Posted Date:
Students also viewed these programming questions
-
Imagine that Costco has $500,000 of sales (selling 31,250 units) in August and has a contribution margin ratio of 40% and fixed costs of $20,000. If sales in units increase by 15% in September, what...
-
The values of Alabama building contracts (in millions of dollars) for a 12-month period follow: 240 350 230 260 280 320 220 310 240 310 240 230 a. Construct a time series plot. What type of pattern...
-
Find the ratio of the width to the perimeter shown of the swimming pool. 30 feet (width) 45 feet (length)
-
Why does the variability of money growth, as well as its average growth rate, tend to increase interest rates and retard investment?
-
Suppose electrons move through a copper wire at speed \(v\). Call the linear charge densities in the Earth reference frame \(\lambda_{E_{p}}\) for the fixed positive ions in the wire and...
-
Sid Davidson is the personnel director of Babson and Willcount, a company that specializes in consulting and research. One of the training programs that Sid is considering for the middle-level...
-
For a particular Java assembler interface, it is known that the operand stack size has the following probability distribution function: 0 1 2 3 4 . 2 5 . 2 0 . 1 8 . 1 7 . 2 0 What is the Expected...
-
Conroy Company manufactures two products-B100 and A200. The company provided the following information with respect to these products: B100 A200 Estimated customer demand (in units) Selling price per...
-
Integrity Company produces chocolate candies that uses Material A and Material B. Material A is added at the start of production, while Material B is added uniformly throughout the process....
-
Aslam Enterprises is looking to evaluate two investment proposals. The following table indicates the expected cash inflows associated with these particular investment proposals. Both dw vestments...
-
Please help!! Analyze financial measures for why Microsoft would be the projected future leader of the artificial intelligence industry. It is expected that you will discuss why you selected the...
-
i) Assume that one of these portfolio's is the Market Portfolio and all portfolios, except Portfolio G, are fairly priced according to the CAPM. In addition assume there is no residual covariance...
-
The following algorithm computes the digits of the binary representation of a positive integer n. String of bits ConvertToBinary(int n) 1: if n == 1 then 2: return n 3: else 4: return...
-
A stock will pay a dividend at the end of the year of $3. The stock price today is $30 and a year from now, it will be $28. Calculate the yield of this stock
-
The trajectory of a ball thrown by a right fielder as defined in the (x,y) coordinates can be modeled as: y = x tan 180 x + Yo 2v cos 180 where the angle at which the ball leaves the right fielder's...
-
For a Poisson process of rate , the Bernoulli arrival approximation assumes that in any very small interval of length , there is either 0 arrivals with probability 1- or 1 arrival with probability ....
-
Data set: Cookies Two students wanted to determine if people could taste the difference in chocolate chip cookies with varying amounts of sugar and varying amount of freshness. Nine batches were...
-
For each of the four Brand/Temp conditions, find the interaction effects with the following formula: condition (Brand/Temp) average (Brand effect + Temp effect + grand mean). Use these values to...
-
a. Use the Wilcoxon rank sum test to conduct a significance test for the bird nest study discussed in Exercise E. 13. b. Use the Kruskal-Wallis test to conduct a significance test for the bird nest...
-
An analysis of the accounts of Beautiful Bottles Pty Ltd reveals the following manufacturing cost data for the month ended 30 June 2019. Required (a) Prepare the cost of goods manufactured schedule...
-
The following accounts and amounts (balances are normal balances) were taken from the records of Prider Manufacturers Ltd at 30 June 2019. Required (a) Prepare a cost of goods manufactured statement...
-
The following data were taken from the records of Manik Manufacturing Ltd for the year ended 30 June 2019. Required (a) Prepare the cost of goods manufactured schedule for the year ended 30 June...
Study smarter with the SolutionInn App