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
Jim has to send an email to his boss requesting medical leave. in which field will Jim type the purpose of his email?​
Liono4ka [1.6K]

Answer: actually idk this is a hard question when i figure it out ill let you know

Explanation:

so basically he will include the purpose of his email

6 0
3 years ago
Read 2 more answers
In addition to explaining the paper’s topic, a thesis statement provides instructions on how to read the paper. explains why the
tamaranim1 [39]

Answer: I believe it’s explains why the paper was written!

Explanation:

Took edge 2021

8 0
3 years ago
Read 2 more answers
In basic network scanning, ICMP Echo Requests (type 8) are sent to host computers from the attacker, who waits for which type of
Hoochie [10]

Answer:

d. ICMP Echo Reply (type 0)

Explanation:

ICMP or internet control message protocol is an Internet layer protocol in the TCP/IP suite. It works together with routing devices like the router to send messages based on results sensed in the network.

The RFC 1122 has stated that the ICMP server and end user application be configured or installed in user devices, for receiving and sending ICMP echo request packets and reply. The process is called pinging.

For an attacker to implement ping of ping, he needs to confirm if the target user in live by sending an ICMP echo request packet type 8, to receive an ICMP echo reply type0.

4 0
3 years ago
1 Let Σ= {Ac,BA,bcb,cd,ab,d,i}. Find the length for the given below strings
Zepler [3.9K]

Answer:

What in the world

Explanation:

4 0
2 years ago
8. Which of the following could be measured by defining a goal in Google Analytics?
Slav-nsk [51]

All of these could be measured by defining a goal in Google Analytics is the answer.

Explanation:

  • Google Analytics is a web analytics service offered by Google that tracks and reports website traffic, currently as a platform inside the Google Marketing Platform brand.
  • Google Analytics is one of the most popular digital analytics software. It is Google's free web analytics service that allows you to analyze in-depth detail about the visitors on your website. It provides valuable insights that can help you to shape the success strategy of your business.
  • Google Analytics works by the inclusion of a block of JavaScript code on pages in your website. When users to your website view a page, this JavaScript code references a JavaScript file which then executes the tracking operation for Analytics.
  • The percentage of visits that result in a site registration , conversion rate , the percentage of visits during which visitors spent at least two minutes on the site all define a goal in Google Analytics.

8 0
3 years ago
Other questions:
  • From the Start screen, you can A. access recently opened Excel workbooks. B. create a document from a template. C. create new bl
    12·2 answers
  • Which statement describes the word "iterative"?
    9·1 answer
  • Disk quotas are set using the ____ console. diskpart disk management mst windows explorer
    10·1 answer
  • Cuales Son las características de la máquina analítica de Carlos Babbage ?
    11·1 answer
  • Why is charles babbage known as father of computer?​
    10·1 answer
  • Suppose we are performing a binary search on a sorted array called numbers initialized as follows: // index 0 1 2 3 4 5 6 7 8 9
    9·1 answer
  • Suppose we are comparing the implementations of insertion sort and merge sort on the same machine(You don’t need to know the alg
    13·1 answer
  • What is a directed graph?
    5·1 answer
  • When you open a program, the hard drive
    7·1 answer
  • A system analyst generally needs to have a number of skills. For example, technical and analytical skills are required for this
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!