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
stiks02 [169]
3 years ago
11

Using the scenario below, answer the following questions:

Computers and Technology
1 answer:
4vir4ik [10]3 years ago
3 0

Answer:

Here is code in java.

import java.util.*;

class Main

{

public static void main (String[] args) throws java.lang.Exception

{

   try{

         boolean flag=false;

         int total_mile=0;

         double avg_mile;

       // part 1, create and initialize array

       int inp[]={2,5,9,11,13,17,20,22,24,26};

       

       System.out.print("miles ran per week: ");

       // print the miles per week of train

       for(int x=0;x<10;x++)

       {

       System.out.print(inp[x]+" ");

       }

        System.out.println();

       //part 2, print the value of index 2 in the list

       System.out.println("value at index 2: "+inp[2]+" miles");

       //part 3, find length of array

       System.out.println("list length: "+inp.length);

     

       // part 4, calculate total mile and average

       for(int y=0;y<10;y++)

       {

       total_mile=total_mile+inp[y];

       }

       System.out.println("total miles ran: "+total_mile+" miles");

       

       avg_mile=total_mile/10.0;

       System.out.println("average no of miles ran= "+avg_mile+" miles");

       

     // part 5, check 4 exist in the list or not

       for(int k=0;k<10;k++)

       {

       if(inp[k]==4)

       {

       flag=true;

       break;

           }

       }

           if(flag)

           System.out.println("4 exist in the list.");

           else

            System.out.println("4 doesn't exists in the list.");  

       

   }catch(Exception ex){

       return;}

}

}

Explanation:

Create and initialize array with list value equals to 2 and maximum value 26. Print the miles of each week.Then find the value of miles at index 2 in the list.Next find the length of the array and print it.Calculate total miles ran of 10 weeks.Then calculate the average miles by dividing the total with 10. In the array, check 4 exist or not.

Output:

miles ran per week: 2 5 9 11 13 17 20 22 24 26                                                                            

value at index 2: 9 miles                                                                                                  

list length: 10                                                                                                            

total miles ran: 149 miles                                                                                                

average no of miles ran= 14.9 miles                                                                                        

4 doesn't exists

You might be interested in
You have installed a streaming video service on your network. You want selected hosts to be able to access this service via a dy
vitfil [10]

You can add the MAC addresses of hosts that you want to allow the access in a database, if you are working on a large scale, and then compare the MAC address of the user in you network wall and allow th users that are allowed.

Or if you are working on a small scale then in your program you can save the MAC in an array or model class and compare when the user will access.

6 0
3 years ago
What are some other possible causes of an overheating laptop
ella [17]
Too much use, air vents are being covered, dust/dirt/other particles clogging the fan making it struggle too cool the laptop down, the internal battery may be low and struggling to function, etc.


I hope this helps you!
8 0
3 years ago
Before sending a packet into a datagram network, the source must determine all the links that packet will traverse between sourc
Llana [10]

Answer:

False

Explanation:

The transport layer is found in both OSI and TCP/IP suite model. It segments and propagates packets across a network. TCP and UDP are protocols in this layer.

UDP is a connectionless protocol, that is to say, it needs no connection for transmission to take place. UDP transfer is unreliable as packets lost are not retransmitted. Unlike the TCP, it's header is smaller and it is faster in transmission, and links to destinations are random and not determined by the source.

3 0
3 years ago
Type the correct answer in the box. Spell all words correctly.
mel-nik [20]

Answer:

internet

Explanation:

8 0
3 years ago
Matt wants to build an app that will reach many people all over the world. However, he worries about having to modify apps for a
Vikentia [17]

Answer:

the answer is C

Explanation:

5 0
3 years ago
Other questions:
  • When age = 16, what action would the program execute?
    6·1 answer
  • How to calculate 100MB at 56 Kbps to transfer time?
    13·1 answer
  • 5
    9·1 answer
  • For connection to place on any network you must have a set of standards?<br> O True<br> O False
    8·1 answer
  • The keyboard usually has six rows of keys. Which of the following is not one of the key group categories?
    7·2 answers
  • Consider having three String variables a, b, and c. The statement c = a + b; also can be achieved by saying_____________.a. c =
    11·1 answer
  • Write a for loop to print all elements in courseGrades, following each element with a space (including the last). Print forwards
    10·1 answer
  • A company is deploying NAFDs in its office to improve employee productivity when dealing with paperwork. Which of the following
    11·1 answer
  • Can anyone talk to me?
    9·2 answers
  • True or false<br>Y axis is also known as the value X.​
    9·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!