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...
-
Suppose that X, Y have constant joint density on the triangle with corners at (4, 0), (0, 4), and the origin. a. Find P(X < 3, Y < 3). b. Are X and Y independent?
-
Medhat International is a manufacturing firm operated along Islamic principles. They wish to raise 20 billion Bahrain dinars and pay this back in equal instalments over 6 years. Comparable Western...
-
Referring to Example 1, use \(q_{0.05}=3.776\) for the Tukey HSD method to examine differences in mean coating weights. Data From Example 1 EXAMPLE I Conducting a one-way analysis of variance To...
-
Consider the following incomplete statements (a) _____ is used by companies that produce small quantities of many different products. (b) Georgia-Pacific pulverizes wood into pulp to manufacture...
-
Three years ago, you purchased a bond for $974.69. The bond had three years to maturity, a coupon rate of 8%, paid annually, and a face value of $1,000. Each year, you reinvested all coupon interest...
-
Journalize all these transactions into a general ledger. Transactions May 1 Purchased merchandise from Keys Wholesale on account for $735.30, Invoice No 91 Dated May 1, terms 2/10, n30 May 2...
-
What are Mercedes-Benz's mission, direction and objectives? (in europe)
-
Marketing organizations use branding as a means of identifying products and developing an image. Branding strategies involve decisions on the brand name and logo , the package design, and the product...
-
Willis Inc. just paid an annual dividend of $2.40 a share. The market price of the stock is $31.80 and the growth rate is 2.5 %. What is the firm's cost of equity? The tax rate = 40%.
-
Given the following 4% bond. Today's date:March 30 th , 2006 Maturity date:January 31 st , 2010 Next coupon payment date:January, 31 st , 2007 Accrued Coupon ( millions):6356.16 Price:101.830 Yield...
-
ABC Company has the following mutually exclusive projects. If the company's payback period is 2 years, which of these projects should be chosen? Project A Year 0 -19,500 1 11,500 2 8,750 3 2,500...
-
8.Home Depot offers an installment loan at 4.39% (add-on rate) if you buy a refrigerator. If the refrigerator at Home Depot costs $2377 and you want to pay for the refrigerator for 4 years, what is...
-
1. Based on your review of the financing section of your company's cash flow statement for the last 2 fiscal years, what appears to be their financing strategy and has it changed in the most recent...
-
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...
-
If the angle between vectors \(\vec{A}\) and \(\vec{B}\) is \(110^{\circ}\) and if \(A=1.7 \mathrm{~N}\) and \(B=2.0 \mathrm{~m}\), what is the value of \(\vec{A} \cdot \vec{B}\) ?
-
You throw a textbook to a friend who is at their dormitory window \(2.2 \mathrm{~m}\) above you. You are standing \(4.0 \mathrm{~m}\) away from the building and your throw is perfectly made such that...
-
A traveller walks \(30 \mathrm{~m}\) along a train platform, dragging their suitcase behind them using a strap attached to the top. The traveller's hand is \(0.25 \mathrm{~m}\) above the top of the...
Study smarter with the SolutionInn App