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
If you could design your own home, what kinds of labor-saving computer network or data communications devices would you incorpor
Kay [80]

Answer:

Access Points, Home Server, and Virtual Assistant/IOT connected devices

Explanation:

There are three main things that should be implemented/incorporated into your design and these are Access Points, Home Server, and Virtual Assistant/IOT connected devices. Access Points for Ethernet, and HDMI should be located in various important walls near outlets. This would allow you to easily connect your devices without having to run cables around the house. A home server will allow you to easily access your data from multiple devices in your home, and if you connect it to the internet you can access that info from anywhere around the world. Lastly, would be a virtual assistant with IOT connected devices. This would allow you to control various functions of your home with your voice including lights, temperature, and locks.

4 0
3 years ago
Another pitfall cited in Section 1.10 is expecting to improve the overall performance of a computer by improving only one aspect
Alexandra [31]

Answer:

<u>note:</u>

<em><u>solution is attached in word form due to error in mathematical equation. furthermore i also attach Screenshot of solution in word due to different version of MS Office please find the attachment</u></em>

Download docx
8 0
3 years ago
When you save a presentation with a .potx file extension, which type of powerpoint file is created?
Elena L [17]
A file with the POTX file extension is a Microsoft PowerPoint Open XML Template file used to maintain the same layout, text, styles, and formatting across multiple PPTX files.
6 0
2 years ago
Isabela wants to modify one of her paragraphs. However, she does not find the command she needs in the Paragraph group. She know
cluponka [151]

Answer:

Editing button

Explanation:

Editing is changing therefore if she wants to modify her work she would be changing it.

Hope that helped :)

5 0
3 years ago
Read 2 more answers
True or False? Most operating systems allow the user to specify a set of paths that are searched in a specific order to help res
inessss [21]

Answer:

The correct answer to the following question will be "True".

Explanation:

The "kernel" as shown at the core of your OS would be the central machine program. The program facilitates the essential functions of a computer processor, including coordinating activities, executing programs, and managing devices. This allows users to define a series of directions to try to resolve the connections to running program files in an order of preference.

So, the given statement is true.

4 0
3 years ago
Other questions:
  • Which of the following are types of formatting you
    12·2 answers
  • Write an application named EnterUppercaseLetters that asks the user to type an uppercase letter from the keyboard. If the charac
    5·1 answer
  • Whats your favorite sport between these options?
    12·2 answers
  • Exercise 4: Bring in program grades.cpp and grades.txt from the Lab 10 folder. Fill in the code in bold so that the data is prop
    12·1 answer
  • What are the concerns surrounding 5G cellular networks?​
    6·1 answer
  • Nathaniel wanted to buy a microphone. He went to an electronics store and was told that there are actually two types of micropho
    13·2 answers
  • Which statements about editing an existing Contact in Outlook are true? Check all that apply.
    9·2 answers
  • Need answer Asap!!!! Which file type is the best choice if the image will be made into a billboard?
    12·1 answer
  • A natural language processor reads the sentence The walk was tiring and mistakes the noun “walk” as a verb. What is such an erro
    13·1 answer
  • PLEASE ANSWER AND HURRY I'LL MARK YOU BRAINLIEST!!<br><br><br>​
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!