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
konstantin123 [22]
2 years ago
11

As in previous prelabs, you can enter all the necessary Java code fragments into the DrJava Interactions pane. If you get an err

or, enter the corrected code. If you get really mixed up, you can reset the interactions pane and try again. Write a while loop that computes the sum of the first 10 positive integers. Write a for loop that computes the sum the first 10 positive integers. For each loop, you should use two variables. One that runs through the first 10 positive integers, and one that stores the result of the computation. To test your code, what is the sum of the first 10 positive integers
Computers and Technology
1 answer:
yuradex [85]2 years ago
5 0

Answer:

public class Main{

public static void main(String[] args) {

 //The While Loop

 int i = 1;

 int sum = 0;

 while(i <=10){

     sum+=i;

     i++;  }

 System.out.println("Sum: "+sum);

 //The for Loop

 int summ = 0;

 for(int j = 1;j<=10;j++){

     summ+=j;  }

 System.out.println("Sum: "+summ); } }

Explanation:

The while loop begins here

 //The While Loop

This initializes the count variable i to 1

 int i = 1;

This initializes sum to 0

 int sum = 0;

This while iteration is repeated until the count variable i reaches 10

 while(i <=10){

This calculates the sum

     sum+=i;

This increments the count variable i by 1

     i++;  }

This prints the calculated sum

 System.out.println("Sum: "+sum);

The for loop begins here

 //The for Loop

This initializes sum to 0

 int summ = 0;

This iterates 1 through 10

 for(int j = 1;j<=10;j++){

This calculates the sum

     summ+=j;  }

This prints the calculated sum

 System.out.println("Sum: "+summ); }

You might be interested in
What is the difference between a syntax error and a logical error?
RoseWind [281]
A syntax error can be a simple mistake as a typo or an extra space. A logical error has to do with the code structure, and if it makes sense.

Hope this helps!
5 0
3 years ago
A __________ note is a private note that you leave for yourself or for other people who might use the presentation file
BaLLatris [955]

Answer:

The answer is that it is a speaker note.

Explanation:

It leaves a note for people that use presentation files. I use it all the time on my google slides.

7 0
2 years ago
Please help ASAP, will mark brainliest!
sp2606 [1]

Answer:

Stick to concrete nouns

Explanation:

The best technique to improve the web search result is that search with the help of keywords. These keywords help in searching the required results from search engines.

The keywords are actually nouns. Noun is name of object, place or person. So by using nouns we can search out required results.

For example

If we want to search about some persons bibliography, we use his name in our search. His name is an example of noun.

3 0
2 years ago
In a non-price rationing system, consumers receive goods and services first-come, first served. Give me an example of a time whe
Anna35 [415]

When someone may be giving away something for free.

7 0
2 years ago
Luentifying message rullidl Upuuns
WITCHER [35]

Answer:

Plain text, Rich Text, and HTML format

Explanation:

In Outlook 2016, three formats are allowed. You can send the plain text only or you can send using the Rich text format. However, there is another sending format as well that is allowed, and it is the HTML format. And by default, if you will let the Outlook choose the most appropriate sending format then the email message will be sent using the HTML format.

7 0
3 years ago
Other questions:
  • Safety interlock module operates by monitoring the voltage from the
    7·1 answer
  • Help me out here pleaseeeee
    9·2 answers
  • Readability is the level of vocabulary used on the page. True or false
    8·1 answer
  • Which of these components is a part of the Central Processing Unit (CPU) of a computer?
    11·2 answers
  • Computer technology has changed our lives write of a least five ways to show how this is so​
    15·1 answer
  • PACIFIC NORTHWEST
    10·1 answer
  • 100 POINTS. DO NOT SPAM. OR I WILL REPORT.
    13·2 answers
  • In java I need help on this specific code for this lab.
    5·1 answer
  • When was the first analog device, the phonautograph, launched?
    14·1 answer
  • What kind of AR target category makes sense for a playing card with a picture on it?
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!