Answered step by step
Verified Expert Solution
Question
1 Approved Answer
java. each picture is its own program. 1. An integer number is said to be a perfect number if its factor, including 1 (but not
java. each picture is its own program. 1. An integer number is said to be a perfect number if its factor, including 1 (but not the number itself), sum to number. For example, 6 is a perfect number, because 6 =1+2+3. Use a loop in an application that determines and displays all the perfect numbers between 2 and 1000. Display the factor of each perfect number to confirm that the number is indeed perfect. Output: 6 is perfect. Factors: 1 2 3 28 is perfect: Factors: 1 2 4 7 14 496 is perfect; Factors: 1 2 4 8 16 31 62 124 248 2. (Duplicate Elimination) Use a one-dimensional array to solve the following problem: Write an application that inputs five numbers, each between 10 and 100, inclusive. As each number is read, display it only if it's not a duplicate of a number already read. Provide for the "worst case," in which all five numbers are different. Use the smallest possible array to solve this problem. Display the complete set of unique values input after the user enters each new value. run: Enter number: 10 10 Enter number: 15 10 15 Enter number: 17 10 1517 Enter number: 14 10 15 17 14 Enter number: 25 10 15 17 14 25 BUILD SUCCESSFUL (total time: 34 seconds) run: Enter number: 10 10 Enter number: 10 10 has already been entered 10 Enter number: 15 10 15 Enter number: 15 15 has already been entered 10 15 Enter number: 17 10 15 17 Enter number: 17 17 has already been entered 10 15 17 Enter number: 19 10 15 17 19 Enter number: 19 19 has already been entered 10 15 17 19 Enter number: 21 10 15 17 19 21 BUILD SUCCESSFUL (total time: 46 seconds)
java. each picture is its own program.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access with AI-Powered Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started