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
arlik [135]
3 years ago
11

Use a physical stopwatch to record the length of time it takes to run the program. Calculate the difference obtained by calls to

the method System.currentTimeMillis() just before the start of the algorithm and just after the end of the algorithm. Calculate the difference obtained by calls to the method System.currentTimeMillis() at the start of the program and at the end of the program so that the elapsed time includes the display of the result. Use the value returned by the method System.currentTimeMillis() just after the end of the algorithm as the elapsed time.
Computers and Technology
1 answer:
Otrada [13]3 years ago
4 0

Answer:

Calculating the Elapsed Running time of algorithm , we put System.currentTimeMillis() at the start of main method and at the end of main Method and calculate the difference.

long end = System.currentTmeMillies();

------Program -------

long end = System.currentTmeMillies();

long elapsedTime = end-start

Explanation:

You might be interested in
Create a server program and a client program. The client program reads a line from a text file, converts everything to upper cas
Tema [17]

Answer:

Explanation:

Find the both server and client files attached below.

Download txt
<span class="sg-text sg-text--link sg-text--bold sg-text--link-disabled sg-text--blue-dark"> txt </span>
<span class="sg-text sg-text--link sg-text--bold sg-text--link-disabled sg-text--blue-dark"> txt </span>
4 0
3 years ago
How do I change the year I was born on this website? I made a mistake and now I can't fix it. Can somebody please help me?
Eddi Din [679]

Answer:

you can go to settings and try to fix it or contact the people of this website

Explanation:

8 0
3 years ago
Create a structure representing a student. The member variables should include student name, student ID, and four test grades fo
Neporo4naja [7]

Answer:

Output:

Name: Brainly

ID:0001

Write the 4 tests grades of the student separated by space :10 9 8 10

Brainly

0001

10 9 8 10

Average :9.66667

'1' to continue '0' to exit :

Explanation:

#include<iostream>

#include<string>

using namespace std;

//variables declaration

struct Student {

  string id; //string declaration ID

  string name; // string declaration name

  int grades[4]; //array of 4 because it is 4 grades

};

//definition of the function get information

void inputData(Student &s){

 

   

   cout << "Name:" ;

   getline(cin,s.name);

   cout << "ID:";

   cin >> s.id;

   cout << "Write the 4 tests grades of the student separated by space :";

   for (int i = 0; i<4; i++)

       cin >> s.grades[i];

}

//definition of the function of average

double inputAvg(Student s){

   double summation;

   int temporary;

   double average;

   for (int i = 0; i<4; i++){  

      for (int j = i; j<4; j++){

         if (s.grades[j] > s.grades[i]){

             temporary = s.grades[i];

             s.grades[i] = s.grades[j];

             s.grades[j] = temporary;

         }

      }

    }

    summation = 0;

    for (int i = 0; i<3; i++){

        summation = summation + s.grades[i];  

    }

    average = summation/3;

    return average;

}

void disp(Student *s){

   cout << s->name << endl;

   cout << s->id << endl;

   for (int i = 0; i<4; i++)

       cout << s->grades[i] << " ";

   cout << endl;

   cout << "Average :" << inputAvg(*s) << endl;

   

}

int main(){

  Student st;

  int ch;

  while(true){

      inputData(st);

      disp(&st);

      cout << " '1' to continue '0' to exit :";

      cin >> ch;

      if (ch == 0)

         break;      

  }

  return 0;

}

6 0
2 years ago
What is one benefit of Powerpoint Online?
VashaNatasha [74]

Answer:

for edge users

anyone with the url

Explanation:

6 0
2 years ago
Read 2 more answers
What changes do you need to make to the algorithm to take as first input the numbers to be compared
Alenkinab [10]

Answer:

Explanation:

The constant function is useful in algorithm analysis, because it characterizes the number of steps needed to do a basic operation on a computer, like adding two numbers, assigning a value to some variable, or comparing two numbers. Executing one instruction a fixed number of times also needs constant time only.

6 0
2 years ago
Other questions:
  • What would a good digital citizen do in the following situation? Nick sees that his classmate left her email account open on a s
    11·1 answer
  • My home PC has IP address 192.168.1.22 and connects to the Internet through a NAT router. Assume I am downloading a web page fro
    5·1 answer
  • We have seen that Internet TCP sockets treat the data being sent as a byte stream but UDP sockets recognize message boundaries.
    13·1 answer
  • What information should be included in the closing paragraph of a thank-you letter? a. Mention skills that were omitted during t
    6·2 answers
  • Structured walk-throughs take place throughout the SDLC and are called _____ reviews, depending on the phase in which they occur
    9·1 answer
  • What arw two reasons for maintaning your privacy on the internet
    11·2 answers
  • A tracking signal A. is computed as the mean absolute deviation​ (MAD) divided by the running sum of the forecast errors​ (RSFE)
    10·1 answer
  • Fill in the blank with the correct response.<br> A submenu in a text editor is indicated by a <br> .
    8·1 answer
  • Question
    5·1 answer
  • Which programming scenario would most likely involve this array block?<br><br>SOMEONE PLEASE HELPPP​
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!