Input Write a program that accepts three integers as inputs and uses those inputs to identify...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Input Write a program that accepts three integers as inputs and uses those inputs to identify numbers in a series. The program that takes three integers as input, named as: low, high, and x. The program then outputs the number of multiples of x between low and high inclusive. The first number is the start point of a range. The second number is the end point of a range. The third number is a factor used for determining which numbers in the range should be considered part of the series. Constraints The inputs must be positive integers. Output Example This means that your program can assume only positive integers will be used. You do not have to write code to prevent the user from providing invalid inputs. Processing Analyse each number that occurs between the start point and endpoint in the range including both the start point and endpoint. Maintain a count for each number that is found, if it is a multiple of the factor (third input). Hint: Use the % operator to determine if a number is a multiple of the factor provided. Use a for loop to test each number between low and high. PRINT the count value that indicates how many numbers were found that met the specified criteria. Example 1 The input is: 1102 Your program will display: 5 Note: There are five numbers in the range 1-10 that are multiples of 2 ie 246810 Activate Wind Go to Settings to Example Example 1 The input is: 1 102 Your program will display: 5 Note: There are five numbers in the range 1 - 10 that are multiples of 2 i.e. 2.4.6.8.10 Example 2 The input is: 379 Your program will display: 0 Note: There are NO numbers in the range 3-7 that are multiples of 9. None of the numbers 3,4,5,6,7 are multiples of 9. Example 3 The input is: 10 80 8 Your program will display: 9 Note: There are nine numbers in the range 10 - 80 that are multiples of 8 i.e. 16, 24, 32, 40, 48, 56, 64, 72, 80 Input Write a program that accepts three integers as inputs and uses those inputs to identify numbers in a series. The program that takes three integers as input, named as: low, high, and x. The program then outputs the number of multiples of x between low and high inclusive. The first number is the start point of a range. The second number is the end point of a range. The third number is a factor used for determining which numbers in the range should be considered part of the series. Constraints The inputs must be positive integers. Output Example This means that your program can assume only positive integers will be used. You do not have to write code to prevent the user from providing invalid inputs. Processing Analyse each number that occurs between the start point and endpoint in the range including both the start point and endpoint. Maintain a count for each number that is found, if it is a multiple of the factor (third input). Hint: Use the % operator to determine if a number is a multiple of the factor provided. Use a for loop to test each number between low and high. PRINT the count value that indicates how many numbers were found that met the specified criteria. Example 1 The input is: 1102 Your program will display: 5 Note: There are five numbers in the range 1-10 that are multiples of 2 ie 246810 Activate Wind Go to Settings to Example Example 1 The input is: 1 102 Your program will display: 5 Note: There are five numbers in the range 1 - 10 that are multiples of 2 i.e. 2.4.6.8.10 Example 2 The input is: 379 Your program will display: 0 Note: There are NO numbers in the range 3-7 that are multiples of 9. None of the numbers 3,4,5,6,7 are multiples of 9. Example 3 The input is: 10 80 8 Your program will display: 9 Note: There are nine numbers in the range 10 - 80 that are multiples of 8 i.e. 16, 24, 32, 40, 48, 56, 64, 72, 80
Expert Answer:
Answer rating: 100% (QA)
CC hare S Contact Us GDB acy nline MultipleCounterjava 1 impo... View the full answer
Related Book For
Calculus Early Transcendentals
ISBN: 978-0321947345
2nd edition
Authors: William L. Briggs, Lyle Cochran, Bernard Gillett
Posted Date:
Students also viewed these programming questions
-
Sarah is working in the operations management industry and wants to take an marketing course for 6 years, starting 6 years from now. Sarah plans to pay herself for this marketing course from his...
-
Case Study: Quick Fix Dental Practice Technology requirements Application must be built using Visual Studio 2019 or Visual Studio 2017, professional or enterprise. The community edition is not...
-
THIRD AVENUE SOFTWARE HEALTH-CARE APP PROJECT This case is new for the ninth edition of Information Technology Project Management . The case provides an opportunity to apply agile and Scrum...
-
Write a program MooresLaw that takes a command-line argument \(n\) and outputs the increase in processor speed over a decade if microprocessors double every \(n\) months. How much will processor...
-
Find the average power absorbed by the network shown in Figure P 9.3 2230o A Figure P 9.3
-
Windsor Cleaner Company uses a weighted-average process costing system and manufactures a single product-an all-purpose liquid cleaner. The company has just completed the manufacturing activity for...
-
0.8859 Use the Standard Normal Table or technology to find the z-score that corresponds to the cumulative area or percentile. Table 4-Standard Normal Distribution Arca Z 0 Z .09 .08 .07 .06 .05 .04...
-
DeMarco Company is developing a cost formula for its packing activity. Discussion with the workers in the Packing Department has revealed that packing costs are associated with the number of customer...
-
7)A certain city covers an area of 62.294 mil 2 . How many square kilometers is this ?Use the conversion factor 1 mile = 1.61 km 8) A projectile is fired at 422.8 mi/hr. How fast is that in meters...
-
Diana and Ryan Workman were married on January 1 of last year. Diana has an eight-year-old son, Jorge, from her previous marriage. Ryan works as a computer programmer at Datafile Inc. (DI) earning a...
-
Describe the material that microtubules are made of. Which cellular structures and functions are microtubules involved in?
-
In the table below, the production quantities and total production costs at various production quantities are shown. For example, fixed costs are IDR 10 thousand. Production Quantity (Units) Price...
-
(a) The equity share of VCC Ltd. is quoted at Rs. 210. A 3-month call option is available at a premium of Rs. 6 per share and a 3-month put option is available at a premium of Rs. 5 per share....
-
a) What do you understand by the term autocorrelation? What are the consequences of autocorrelation in estimation? (5 marks) b) What are the assumptions underlying the Durbin Watson statistics in...
-
61. The solubility product of CuS, AgS and HgS are 10 37, 104 and 1054 respectively. The solubility of these sulphides will be in the order (1) HgS> AgS > Cus (2) AgS>HgS > CuS (3) CuS AgS > HgS (4)...
-
Sam and Esterina are married, file a joint return, and have two children, ages 9 and 12. Their combined AGI is $67,000. Sam's earned income is $43,000; Esterina's is $27,000. They incur $6,900 of...
-
(10 points): Find the Laplace transform of the following functions: (a) te- sin 2t (b) 2, t, et-3 +3, if t < 2, if 2 < t < 3, if 3 t.
-
The first national bank pays a 4% interest rate compound continuously. The effective annual rate paid by the bank is __________. a. 4.16% b. 4.20% c. 4.08% d. 4.12%
-
Approximate the area of the region bounded by the graph of f(t) = cos (t/2) and the t-axis on [0, ] with n = 4 subintervals. Use the midpoint of each subinterval to determine the height of each...
-
Let f(x) = x 2 - 2x + 3. a. For = 0.25, find the largest value of > 0 satisfying the statement |f(x) - 2| < whenever 0 < |x - 1| < . b. Verify that as follows. For any > 0, find the largest value...
-
Use a table of integrals to determine the following indefinite integrals. :dx V4x + 1
-
You own your own firm, and you want to raise \($40\) million to fund an expansion. Currently, you own 100% of the firms equity, and the firm has no debt. To raise the \($40\) million solely through...
-
If investors are holding optimal portfolios, how will the portfolios of a more risk averse and a more risk-tolerant investor differ?
-
According to the managerial entrenchment theory, managers choose capital structures so as to preserve their control of the firm. On the one hand, debt is costly for managers because they risk losing...
Study smarter with the SolutionInn App