1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
TEA [102]
3 years ago
5

Write an application named Perfect that displays every perfect number from 1 through 10,000. A number is perfect if it equals th

e sum of all the smaller positive integers that divide evenly into it. For example, 6 is perfect because 1, 2, and 3 divide evenly into it and their sum is 6.

Computers and Technology
1 answer:
frozen [14]3 years ago
6 0

Answer:

Required code is given and the output is also attached.

Explanation:

public class Perfect {

   public static void main(String[] args) {

       int i, num, sum;

       System.out.println("The perfect numbers between 1 and 1000 are");

       num = 1;

       while (num <= 1000) {

           sum = 0;

           for (i = 1; i < num; i++)

               if (num % i == 0)

                   sum += i;

           if (sum == num)

               System.out.println(num + " ");

           num++;

       }

   }

}

You might be interested in
Which of the following acts as the central authority in the network?
kiruha [24]

Answer:

Server

Explanation:

i know it will be server

4 0
4 years ago
A compound Boolean expression created with the _________ operator is true if either of its subexpressions is true.
lbvjy [14]
The answer for the question is butt
3 0
3 years ago
If You're is in credit card debt, why can't you just say your card was stolen so you can avoid the debt.
liubo4ka [24]
You can not claim this because most times credit card issuers will be able to match purchases and charges to your location, ex stores around you, online purchases sent to your location.
8 0
3 years ago
Read 2 more answers
ammy's Seashore Supplies rents beach equipment such as kayaks, canoes, beach chairs, and umbrellas to tourists. Write a program
melomori [17]

Answer:

// Here is SammysRentalPrice.java file

// import package

import java.util.*;

// class definition

class SammysRentalPrice

{

   // main method of the class

public static void main (String[] args) throws java.lang.Exception

{

   try{

    // object to read value from user

    Scanner scr=new Scanner(System.in);

    // ask to enter rented minutes

       System.out.print("enter rented minutes: ");

       // read minutes

       int min=scr.nextInt();

       // find hours

       int hour=min/60;

       //reamining minutes

       min=min%60;

       // total cost

       int cost=hour*40+min*1;

       // print cost

       System.out.println("total cost is: "+cost);

   }catch(Exception ex){

       return;}

}

}

Explanation:

Read rented minutes from user and assign it to variable "min".Find the hours from minutes and then update the remaining minutes.After this multiply hours with 40 and remaining minutes with 1.Sum them and this will be the cost of rented a sports equipment.

Output:

enter rented minutes: 145

total cost is: 105

8 0
4 years ago
Define an array of the length 6 with the elements of WORD type. Initialize the first and the last of them with the same value of
Llana [10]

Answer:

string words[6];

words[0]="humming";

words[1]=words[0];

Explanation:

The above statement declares an array of size 6 which can store elements of type string or word. Then I have initialized the first and second elements with the word humming and the rest of the places in the arrays are uninitialized.

You have to include the header file string so that this array could work otherwise it will not.

6 0
3 years ago
Other questions:
  • The number of colors available in a graphic is referred to as......what?
    5·1 answer
  • When a dynamic array with a class for a base type is declared, which constructor is called?
    5·1 answer
  • Which of the following are valid values for a boolean value in programming? (Select all that apply)
    8·1 answer
  • Why were video games invented?
    6·1 answer
  • Font size, font style, and _______ are all aspects of character formatting.
    14·2 answers
  • What type of display allows the user to access a large amount of vocabulary in one device, uses spelling to convey the message,
    10·1 answer
  • Which statement assigns the value 140 to the variable streetNumber in Python?
    13·1 answer
  • Does anyone else have edge and think its not the awful?
    12·2 answers
  • [If you were the queen of the world .... What would you change ?]
    14·1 answer
  • Que implicaciones sociales puede tener la robótica
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!