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
Can someone please help with one? I will mark brainlest!!!
Snowcat [4.5K]

I want to say that it is data authenticity?

4 0
3 years ago
Read 2 more answers
What is the top anime shows? &lt;3
LenKa [72]

Answer:

This is personally based on my opinion.

My top 10 favorites

Toradora

Darling in the franxx

Lucky Star

My Melody

Death note

Attack on titans

One piece

The Promise neverland

Kaguya-sama: love is war

Black cover

4 0
2 years ago
Read 2 more answers
What is a true job in the information age?​
Gelneren [198K]

Answer:

apple

you get a lot of information about the technology you paid for.

if this was not helpful comment and I’ll fix it!

3 0
2 years ago
An intruder with malicious intent breaks into an office and steals a hard drive
Leya [2.2K]

Based on the above, the type of security is illustrated in this example is known as data security.

<h3>What is Data security?</h3>

This is known to be the act of keeping safe data from unauthorized access and its corruption in all of its lifecycle.

Note that in the case above, the intruder is interested in the companies data and as such,  the type of security is illustrated in this example is known as data security.

Learn more about  security from

brainly.com/question/15668437

#SPJ1

6 0
2 years ago
Write a program that will read in a line of text and output the number of words in the line and the number of occurrences of eac
kherson [118]

Answer:

Here is the C++ program:

#include<iostream>  //to use input output functions

#include <algorithm>  //to use tolower() function

using namespace std;  //to identify objects like cin cout

int main() {  //start of main function

 string text;  // to hold text input

 cout<<"Enter a line of text: ";  // prompts user to enter a string

 getline(cin,text);  // reads the input string (text) from user

transform(text.begin(), text.end(), text.begin(), ::tolower);  //converts the text into lower case

 int letter[26] = {0}; //to hold the letters

 int i;  // used as a loop variable

 int words=0;  // to hold the count of words

 for(i = 0; i< text.size();i++){  // iterates through the text

 if(isalpha(text[i])&&(text[i+1]=='.'||text[i+1]==','||text[i+1]==' '))  //checks if the character at i-th index of text is a letter, and checks if i+1 index position of text is a period, comma or a space

 words++;  // adds 1 to the count of words

 if(isalpha(text[i]))  // if the character at the i-th index of text is a letter

 letter[text[i]-'a']++;  }  // counts the occurrences of each letter

 char j = text[text.size()-1];  // sets j to the last character of text

 if(j != '.' && j!= ' '&& j!=',' &&j!= '\0')  //if the last character is not a period or empty space  or comma or end of lone

 words++;  //add 1 to the count of words

 cout<<"Number of words: "<<words<<endl;  //display the number of words in the text

 for(i=0; i<26; i++)  {  //iterates 25 times

   if(letter[i]>0)  //if letter at index i is greater than 0

   cout<<(char)('a'+i)<<" : "<<letter[i]<<endl;  }} //displays each letters and its number of occurrences in the text

 

Explanation:

The program is explained in the attached document with an example.

7 0
3 years ago
Other questions:
  • Which is true about POP3 and IMAP for incoming email?
    6·1 answer
  • If you are driving at night, you should not use high-beam headlights within _________ of oncoming vehicles. Florida Road Rules 4
    9·2 answers
  • When you identify the data elements in a new database, you typically subdivide data elements into?
    14·1 answer
  • Working for the Internal Revenue Service is a career in public safety. A. True B. False
    14·1 answer
  • What does the following statement do? vector v(10, 2);
    6·1 answer
  • Question 3 of 10
    7·1 answer
  • Pleas help 99 points and get brainliest
    9·2 answers
  • How to be fluent in computer
    10·2 answers
  • X274: Recursion Programming Exercise: Cannonballs Spherical objects, such as cannonballs, can be stacked to form a pyramid with
    7·1 answer
  • Immigrants are allowed to enter the country to work when they have a(n)
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!