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
Rasek [7]
3 years ago
7

Write a for loop that computes the following sum: 5+10+15+20+...+485+490+495+500. The sum should be placed in a variable sum tha

t has already been declared and initialized to 0. In addition, there is another variable, num that has also been declared. You must not use any other variables.
Computers and Technology
1 answer:
Strike441 [17]3 years ago
6 0

Answer:

public class num9 {

   public static void main(String[] args) {

       int sum =0;

       int num =5;

       for(num =5; num<=500; num+=5){

           System.out.println(num);

           sum +=num;

       }

       System.out.println(sum);

   }

}

Explanation:

  • Declare and initialize the variables sum and num
  • Use a for loop with the condition for(num =5; num<=500; num+=5) Since the loop will increment by 5 and run from 5 to 500
  • Within the loop, add num to sum at each iteration
  • Print all elements on seperate lines
  • Outside the loop, print the final value of sum

Create a for loop

You might be interested in
PLS HELP) Early word processors ran on devices that looked like digital _______?
stealth61 [152]
I looked it up it just says true
8 0
3 years ago
Read 2 more answers
What does the security element of non-repudiation mean in e-commerce cybersecurity? A. Data needs to be available at all times.
VARVARA [1.3K]

Answer:

Non-repudiation is the assurance that someone cannot deny the validity of something. Non-repudiation is a legal concept that is widely used in information security and refers to a service, which provides proof of the origin of data and the integrity of the data

Explanation:

8 0
3 years ago
What is the difference between operating systems and application software?
Oliga [24]
The operating system is what allows the user to interact with the computer's hardware. It has basic services such as accepting commands from the user, managing, loading, and executing programs, and managing hardware resources. Some examples of operating systems are Windows, Linux, Mac OSX, and IOS.

Application software are pieces of software that perform specific tasks such as word processors.
5 0
3 years ago
Biometric devices are often associated with computer and data security. True False
Leya [2.2K]

Answer:

True

Explanation:

5 0
3 years ago
A computer never gets tired or bored while working for a long time .. ​
Angelina_Jolie [31]

Answer :Computers never get tired or bored because of doing the same task continuously. They work in the same manner all the time. A computer can store large amount of information in its memory.

Explanation: it is quality which makes the user to be dependent on computer. As we all know, computer systems do repetitive tasks without any boredom, tiredness, or fatigue.

5 0
3 years ago
Other questions:
  • Which is an example of a zero-point perspective?
    11·1 answer
  • What’s the answer to this question?
    15·1 answer
  • John was carrying on at the water cooler the other day, trying to show off his knowledge of networking. He claimed that the comp
    10·1 answer
  • Anyone here good with python coding. I have some machine learning homework which I am having a hard time with,
    12·1 answer
  • Select the correct answer.
    6·1 answer
  • which feature of organisations to manage needs to know about to build and use information system successfully
    6·1 answer
  • HELPPP
    5·1 answer
  • Which TWO of these correctly describe a Trojan horse malware?
    11·2 answers
  • 56- What is the term used when you press and hold the left mouse key and more the mouse
    8·1 answer
  • Add comma(s) where needed, if needed.
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!