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
The camera on a phone or laptop can be used to track a user's eye movements. Which of these is NOT one of the possible applicati
AnnyKZ [126]

Answer:

The question is incomplete. The full question is the following one:

"The camera on a phone or laptop can be used to track a user's eye movements. Which of these is NOT one of the possible applications of this technology (as listed in the course reading):

All of these ARE:

Measuring the user's intelligence,

Gathering marketing information for advertisers,

Detecting cognitive disorders."

The correct answer is: "Measuring the user's intelligence".

Explanation:

This technology is also known as eye tracking technology and has to do with a sensor that tracks eye movement and interaction with machines, such as mobiles and computers. The only option which does not apply to this technology and its features is the first one, "Measuring the user's intelligence", because "intelligence" is very subjective and abstract, it is not something a sensor can measure, although eye tracking technology can measure the amount of production concerning certain topics, the level of interest, attention, and interaction, and some cognitive disorders people behave, such as Attention Deficit Hyperactivity Disorder (ADHD). Besides that, companies, agencies, and institutional systems may track and gather people's eye movements in order to share them with other companies, agencies, and institutions for improving marketing, production, and interests.

(ps: mark as brainliest, please?!)

8 0
3 years ago
Which best compares portrait and landscape orientations?
julsineya [31]
#2: Portrait taller than wide & landscape wider than tall
8 0
3 years ago
Which of the following tasks is the project manager least likely to be involved in?
user100 [1]

Answer:

i think its d sorry if i am wrong

3 0
3 years ago
Read 2 more answers
What can you do if brainstorming only gives you a small or incomplete idea?
Grace [21]

Answer:

D. All of the above

Explanation:

5 0
3 years ago
How do Hlookup and Vlookup differ?
german

HLOOKUP performs the same function as VLOOKUP, but looks up data that has been formatted by rows. HLOOKUP searches for a value in the top row of a table, and then returns a value in the same column from a row you specify in the table or array

6 0
3 years ago
Read 2 more answers
Other questions:
  • Whichof the following is not a standard method called as part of the JSPlife cycle?jspInit()jspService()_jspService()jspDestroy(
    12·1 answer
  • The ________ is(are) used to display information on the computer's screen.
    13·1 answer
  • Which of these symbols is a special character that is accessible only from the Symbol dialog box? A. © B. + C. é D.
    13·2 answers
  • Componets of computer
    5·1 answer
  • What does the following loop do?
    5·1 answer
  • What icons in the toolbar change the look of the presentation text? It’s either Drawing, Formatting,Presentation, or Standard
    9·2 answers
  • In PowerPoint online what can you add to your presentation from the insert tab
    8·2 answers
  • Wht is these things Aᔑ bʖ cᓵ d↸ eᒷ f⎓ g⊣ h⍑ i╎
    15·2 answers
  • PLEASE HELP FIRST ONE TO ANSWER WILL GET BRAINLIEST!!
    10·1 answer
  • During the data transmission there are chances that the data bits in the frame might get corrupted. This will require the sender
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!