Lab 5: Module 4 - Repetition Lab 1. (OddNumbers.java) Write a while loop that asks the...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Lab 5: Module 4 - Repetition Lab 1. (OddNumbers.java) Write a while loop that asks the user to enter a series of odd numbers and calculate the summation of them. If the user enters an even number, the loop will stop. Print the total after the loop terminates. Only integers will be entered! Only odd numbers should be added to the total. 2. (CompleteNumbers.java) A complete number is a number that equals to the sum of its divisors. For example, 28 is a complete number, because its divisors are 1, 2, 4, 7, and 14 and the sum of them equals to 28. Write a program that finds all the complete numbers between 1 to 30,000. Then print that numbers and print how many complete numbers your code has found. Lab 5: Module 4 - Repetition Lab 1. (OddNumbers.java) Write a while loop that asks the user to enter a series of odd numbers and calculate the summation of them. If the user enters an even number, the loop will stop. Print the total after the loop terminates. Only integers will be entered! Only odd numbers should be added to the total. 2. (CompleteNumbers.java) A complete number is a number that equals to the sum of its divisors. For example, 28 is a complete number, because its divisors are 1, 2, 4, 7, and 14 and the sum of them equals to 28. Write a program that finds all the complete numbers between 1 to 30,000. Then print that numbers and print how many complete numbers your code has found. Lab 5: Module 4 - Repetition Lab 1. (OddNumbers.java) Write a while loop that asks the user to enter a series of odd numbers and calculate the summation of them. If the user enters an even number, the loop will stop. Print the total after the loop terminates. Only integers will be entered! Only odd numbers should be added to the total. 2. (CompleteNumbers.java) A complete number is a number that equals to the sum of its divisors. For example, 28 is a complete number, because its divisors are 1, 2, 4, 7, and 14 and the sum of them equals to 28. Write a program that finds all the complete numbers between 1 to 30,000. Then print that numbers and print how many complete numbers your code has found.
Expert Answer:
Answer rating: 100% (QA)
Heres the Java code for both programs 1 OddNumbersjava ... View the full answer
Related Book For
Starting Out With Java From Control Structures Through Data Structures
ISBN: 9780133957051
6th Edition
Authors: Tony Gaddis
Posted Date:
Students also viewed these programming questions
-
Discuss the differences between managing change and leading change.Define the advantages of being a change leader. Explain how these change leader advantages can strengthen your own career and...
-
can someone solve this Modern workstations typically have memory systems that incorporate two or three levels of caching. Explain why they are designed like this. [4 marks] In order to investigate...
-
Predictive text entry systems are familiar on touch screens and mobile phones. This question asks you to consider how the same principles might be used in a programming editor for creating Java code....
-
Lavage Rapide is a Canadian company that owns and operates a large automatic car wash facility near Montreal. The following table provides data concerning the company's costs: Fixed Cost Cost per Car...
-
Show that we can accomplish any row interchange by using only row operations of other types.
-
I 5 H + P5-25 (Hint: assume the investment is $100), Approximately how many years would it take for an investment to grow sevenfold if it were invested at 10% compounded semiannually? PV i nper m FV...
-
Refer to the balance sheet data given in Exercise E13-3B. a. Prepare common-size balance sheets for each year (use total assets as the base amount for computing percentages). b. Compare the...
-
Using the information in Problem 1, determine the sample size needed if the standard time estimate is to be within 5 percent of the true mean 99 percent of the time.
-
4 5 6 7 8 9 10 Or PDF 11 es Outli 12 13 14 45 16 17 _Art_Pr 18 ...pg.we 19 20 15 21 H 22 23 24 nstructi. 25 26 27 28 29 30 31 E10.7 Harrisburg Furniture Company started construction of a combination...
-
Ayayai Hotels Ltd. (AHL) is a small boutique hotel that provides 44 suites that can be rented by the day, week, or month. Food service is available through room service as well. In addition, there...
-
A composite solid consists of a rectangular block of lightweight concrete and a triangular wedge of steel with dimensions as shown. The rectangular block has a 2 ft radius circular hole drilled...
-
Simplify (x-2)2 (x+3) 2 4- X-5 2x-1 X+ 3 2x+6
-
WebHelper Incorporated acquired 100% of the outstanding stock of Silicon Chips Corporation (SCC) for $46.8 million, of which $18.6 million was allocated to goodwill. At the end of the current fiscal...
-
How does the interplay between symbolic artifacts and espoused values shape the organizational culture's manifestation within a dynamic work environment ?
-
A 1.67 C charge is at the origin and a -4.7 C charge is 10 cm to the right, as shown. II ILI. -4.7 C 1.67 C 10 cm III Identify the direction of E in the re- gion II (0 < x < 10 cm, along the x-...
-
Inverse Square Law: Saving Stacy Stacy has aspirations of being a famous TikTok-er /molecular biologist. Furthermore, as an astute practitioner of time management skills, Stacy has hundreds of videos...
-
Consider the Sequential Intercept Model and your area of interest in criminal justice, whether it is in the courts, police department, probation, parole, or detention. What does "intake" look like?...
-
Making use of the tables of atomic masses, find the velocity with which the products of the reaction B10 (n, ) Li7 come apart; the reaction proceeds via interaction of very slow neutrons with...
-
What does it mean to throw an exception?
-
Write a for loop that displays every fifth number, zero through 100.
-
What is an is-a relationship?
-
The chapter highlighted one way in which the Procter \& Gamble Company demonstrates its commitment to being a good corporate citizen. Go to Procter \& Gamble's Website and navigate to the section on...
-
Below are income statements and balance sheets for the Peyton Company for 2019 and 2018: Required Calculate the following ratios for the Peyton Company for 2019 and 2018 and discuss your findings: 1....
-
Which of the following information system functions is generally responsible for the design, coding, and debugging of computer programs? (a) technical support (b) programming (c) operations (d)...
Study smarter with the SolutionInn App