5.25 LAB*: Program: Drawing a half arrow Program Specifications Write a program that outputs a downwards...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
5.25 LAB*: Program: Drawing a half arrow Program Specifications Write a program that outputs a downwards facing arrow composed of a rectangle and a right triangle. Arrow dimensions are defined by user specified arrow base height, arrow base width, and arrow head width. Note: this program is designed for incremental development. Complete each step and submit for grading before starting the next step. Only a portion of tests pass after each step but confirm progress. Step 1 (3 pts). Input the arrow base height (int) and width (int). Draw a rectangle using asterisks (height x width). Hint: use a nested loop in which the inner loop draws one row of *s, and the outer loop iterates a number of times equal to the height. Submit for grading to confirm two tests pass. Ex: If input is: 6 4 Sample output is: **** **** **** **** **** Step 2 (3 pts). Input the arrow head width and draw a right triangle. Hint: use a nested loop. Submit for grading to confirm four tests pass. Ex: If input is: 4 3 4 Step 3 (4 pts). Modify the program to only accept an arrow head width that is larger than the arrow base width. Use a loop to continue inputting the arrow head width until the value is larger than the arrow base width. Submit for grading to confirm all tests pass. Ex: If input is: 4 3 2 4 Sample output is: *** *** *** *** **** *** ** * 5.25 LAB*: Program: Drawing a half arrow Program Specifications Write a program that outputs a downwards facing arrow composed of a rectangle and a right triangle. Arrow dimensions are defined by user specified arrow base height, arrow base width, and arrow head width. Note: this program is designed for incremental development. Complete each step and submit for grading before starting the next step. Only a portion of tests pass after each step but confirm progress. Step 1 (3 pts). Input the arrow base height (int) and width (int). Draw a rectangle using asterisks (height x width). Hint: use a nested loop in which the inner loop draws one row of *s, and the outer loop iterates a number of times equal to the height. Submit for grading to confirm two tests pass. Ex: If input is: 6 4 Sample output is: **** **** **** **** **** Step 2 (3 pts). Input the arrow head width and draw a right triangle. Hint: use a nested loop. Submit for grading to confirm four tests pass. Ex: If input is: 4 3 4 Step 3 (4 pts). Modify the program to only accept an arrow head width that is larger than the arrow base width. Use a loop to continue inputting the arrow head width until the value is larger than the arrow base width. Submit for grading to confirm all tests pass. Ex: If input is: 4 3 2 4 Sample output is: *** *** *** *** **** *** ** *
Expert Answer:
Related Book For
Managerial Economics and Business Strategy
ISBN: 978-0073523224
8th edition
Authors: Michael Baye, Jeff Prince
Posted Date:
Students also viewed these accounting questions
-
You are the manager of a department store in Tokyo. Sales are subject to month-to-month variations, depending on the individual salesclerks efforts and other factors. A new salary-plus-bonus plan has...
-
You are the manager of a successful gift shop. After a meeting with her accountant, the owner of the shop has told you that the shops cost of goods sold should be about 30 percent of total sales...
-
You are the manager of a retail electronics store. Recently, you purchased 200 What-A-Sound portable CD players from a wholesaler in a going-out-of-business sale. These units cost you $80 each, about...
-
In a task assignment situation, in how many different ways can five jobs be assigned to five machines if each job must be assigned to each machine and each machine must be assigned one job? Multiple...
-
Many luxury automobiles have thermostatically controlled air-conditioning systems for the comfort of the passengers. Sketch a block diagram of an air-conditioning system where the driver sets the...
-
Suppose that we are testing H0: 1 = 2 versus H1: 1 2 and we plan to use equal sample sizes from the two populations. Both populations are assumed to be normal with unknown but equal...
-
How can social media aid in developing a questionnaire?
-
The Amberssen Specialty Company is a chain of 12 retail stores that sell a variety of imported gift items, gourmet chocolates, cheeses, and wines in the Toronto area. Amberssen has an IS staff of...
-
The income statement is an important financial statement because it provides investors, creditors, and managers with information that helps them predict the amount, timing, and uncertainty of future...
-
One model A1100 Kawasaki Jet Ski Personal Watercraft was sold for cash. This model retails for $9,375.00 plus 8% sales tax ($9,375.00 x 8% = $750.00). Invoice Number: G4011. Because a perpetual...
-
Assume a company purchases honeycombs from beekeepers for $2.00 a pound. The honey can be sold in raw form for $3.20 a pound or it can be used to make honey drop candies. Each package of candies...
-
One Day in the Seat of the Chair of the Federal Reserve Board. Imagine that you have been given the opportunity to serve as Chair of the US Federal Reserve Board. Please answer the following: 1)Your...
-
Countries world over have been running widening budget deficits and accumulating debt pileup over time including Zambia. In your view, what must the country do to bring sustainability to its public...
-
Prepare the monograph on the topic: Employability and the current labor market and develop the topics: 1. Current Labor Market in Peru. 2. Challenges and opportunities in employability in Peru after...
-
Suppose that the company operates in two market areas A and B, and the price vector of the products sold is p=[p1,p2] is the same in both regions. In area A, the number vector qA=[1,4] scalar product...
-
Spend approximately 30 minutes using the LIRN library and find an example of either a quantitative or qualitative research article. You can access the LIRN Library in the Canvas navigation bar....
-
Communication Plan Template Complete the Communication Plan Template. Identify all the stakeholders and resources that are noted within the case. Identify a minimum of two additional stakeholders or...
-
During registration at Tech every quarter, students in the Department of Management must have their courses approved by the departmental advisor. It takes the advisor an average of 4 minutes...
-
Based on the best available econometric estimates, the market elasticity of demand for your firms product is 2. The marginal cost of producing the product is constant at $ 150, while average total...
-
When trying to assess differences in her customers, Clairethe owner of Claires Rose Boutique noticed a difference between the typical demand of her female versus her male customers. In particular,...
-
The market for a standard- sized cardboard container consists of two firms: CompositeBox and Fiberboard. As the manager of CompositeBox, you enjoy a patented technology that permits your company to...
-
Consider the problem of transient heat transfer with a constant heat source in a slab. Show that the governing equation in dimensionless form is \[\begin{equation*}\frac{\partial \theta}{\partial...
-
Eigenvalues without pain: CHEBFUN code. Eigenfunctions can be derived using the CHEBFUN with MATLAB since it has an overloaded eig function. The following code solves for the eigenfunctions of the...
-
For the Biot problem in a slab by expanding the sin and cos term and keeping only terms up to \(\lambda^{2}\) the following approximate relation can be obtained for the eigenvalues for small Biot...
Study smarter with the SolutionInn App