1. Countries that use the English system of measurement mark each inch on a ruler into...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
1. Countries that use the English system of measurement mark each inch on a ruler into fractions using tick marks such as the figure to the right. The longest tick marks falls at the inch position, one smaller tick mark indicates the half- inch position, two smaller tick marks indicate quarter inches, and even smaller ones are used to mark the eighths 0 and sixteenths. Write a C++ program that draws a ruler using tick marks. Assume that the length of each tick mark indicating the half-inch position is given by the constant definition: 1/16 3/16 5/16 7/16 9/16 11/16 13/16 15/16 TT 3/4 Sample Run: How many inches (0-3): 1 T20 TT! 3/8 5/8 1/8 1/4 1/2 7/8 1 const double HALF_INCH_TICK = 0.5; and that each tick mark is one bar small than the previous larger one. Let the user enter the length of the ruler (0-3) to draw in whole inches. Recursion must be used for full credit. Error check input. Refer to the sample output below. 1. Countries that use the English system of measurement mark each inch on a ruler into fractions using tick marks such as the figure to the right. The longest tick marks falls at the inch position, one smaller tick mark indicates the half- inch position, two smaller tick marks indicate quarter inches, and even smaller ones are used to mark the eighths 0 and sixteenths. Write a C++ program that draws a ruler using tick marks. Assume that the length of each tick mark indicating the half-inch position is given by the constant definition: 1/16 3/16 5/16 7/16 9/16 11/16 13/16 15/16 TT 3/4 Sample Run: How many inches (0-3): 1 T20 TT! 3/8 5/8 1/8 1/4 1/2 7/8 1 const double HALF_INCH_TICK = 0.5; and that each tick mark is one bar small than the previous larger one. Let the user enter the length of the ruler (0-3) to draw in whole inches. Recursion must be used for full credit. Error check input. Refer to the sample output below.
Expert Answer:
Answer rating: 100% (QA)
Code import javautil import javalang import javautilScanner clas... View the full answer
Related Book For
Macroeconomics Principles, Applications, and Tools
ISBN: 978-0132555234
7th Edition
Authors: Arthur O Sullivan, Steven M. Sheffrin, Stephen J. Perez
Posted Date:
Students also viewed these programming questions
-
3 4 5 6 7 8 9 10 11 12 13 A 14 Cost of the Asset 15 Life of the Asset in Years 16 Book Value of the Asset after 5 years 17 Depreciable Basis 18 Yearly depreciation 19 After tax Salvage Value in year...
-
Assume that several European countries that use the euro as their currency experience higher inflation than the United States, while two other European countries that use the euro as their currency...
-
The Eurozone consists of 17 European countries that use the euro as their common currency. The European debt crisis, which began in 2009, made it difficult for some Eurozone countries to repay their...
-
Delta Catfish Company has taken a position in its tax return to claim a tax credit of $10 million (direct reduction in taxes payable) and has determined that its sustainability is more likely than...
-
What factors must be considered when a contractor develops the proposal price? Why is this not an easy task?
-
Consider the following class Method Trace: What does the following code print out? public class MethodTrace { public MethodTrace ( ) { } public void sayCheese ( ) { } System.out.print ("Cheese");...
-
Statistical distance between records can be measured in several ways. Consider Euclidean distance, measured as the square root of the sum of the squared differences. For the first two records in...
-
A wheel of radius r and centroidal radius of gyration k is released from rest on the incline shown at time t = 0. Assuming that the wheel rolls without sliding, determine (a) The velocity of its...
-
[50 pts] Write an assembly program that performs multiplication by addition: a. First, you should define a variable which is a string in the format of "a*b" where a and b represent numbers from 0 to...
-
The weights of 220 sausages are summarised in the following table. i. State how many sausages weighed between 50g and 60g. ii. On graph paper, draw a histogram to represent the weights of the...
-
Rotate the ball horizontally on an 80 cm long non-stretchable cord with angular velocity of 3 s^(-1). After ten seconds of clockwise rotation, the cord breaks. At what speed and in what direction...
-
Accounts and notes receivable are reported in the current assets section of the statement of financial position at: a. cash (net) realizable value. b. net book value. c. lower-of-cost-or-net...
-
What maximum height above the surface of Earth does an object attain if it is launched upward at \(4.0 \mathrm{~km} / \mathrm{s}\) from the surface?
-
(a) Derive an expression for the energy needed to launch an object from the surface of Earth to a height \(h\) above the surface. (b) Ignoring Earth's rotation, how much energy is needed to get the...
-
Under IFRS: a. the entry to record estimated uncollectible accounts is the same as GAAP. b. all impairments should be debited to Accounts Receivable. c. it is always acceptable to use the direct...
-
A National Health Survey determined that the mean weight of a sample of 804 men ages 25 to 34 years was 176 pounds, while the mean weight of a sample of 1,657 men ages 65 to 74 years was 164 pounds....
-
Assume that the stature of the 5th and 90th percentiles of a given population are, respectively, 149.35 cm and 178.60 cm. Find the average and standard deviation of this measurement.
-
DC has unused FTC carryover from 2017 in the separate category for GC income as the result of income generated by a foreign branch. The income was foreign source general category income. In 2018 the...
-
1. The dollar _______ against the euro when the European central bank lowers interest rates. 2. If the dollar appreciates against the euro, then the euro also _______ against the dollar. 3. The...
-
As an example of a market that results from comparative advantage, consider the market for virtual currency. Firms in China pay workers (called gold farmers) to play the online game World of War...
-
In 2008 Mexico banned the importation of all used cars except cars produced in the model year 1998. Before then, it was legal to import used cars 10 to 15 years old, and enterprising firms purchased...
-
In the 2016 Olympics in Rio, after the 50 m freestyle competition, a problem with the pool was found. In lane 1 there was a gentle 1.2 cm/s current flowing in the direction that the swimmers were...
-
A soccer player takes a free kick from a spot that is 20 m from the goal. The ball leaves his foot at an angle of 32, and it eventually hits the crossbar of the goal, which is 2.4 m from the ground....
-
The moon completes one (circular) orbit of the earth in 27.3 days. The distance from the earth to the moon is 3.84 10 8 m. What is the moons centripetal acceleration?
Study smarter with the SolutionInn App