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
1. Describe how research and development influence design. Cite specific examples of how research and development influence desi
vladimir1956 [14]

Answer:

so i research and found this,

Development is when findings of a research are utilized for the production of specific products including materials, systems and methods. Design and development of prototypes and processes are also part of this area. Engineering is utilization of these plans and research to produce commercial products.

4 0
3 years ago
What is the main function of an operating system​
alina1380 [7]

Here are the main functions of an operating system:

1) Manage the resources of the device

The operating system controls how much of each resource is distributed, and it controls things like the processing unit and memory.

2) Establish a interface for the user of the device

The operating system must classify what the classes of the script/code have to do and what they implement.

3) Service application software

The operating system must service each application that is downloaded onto the device. It must balance it's use of storage between apps.

4 0
3 years ago
Jacob would like to include an arrow in his newsletter to point to some important information. He should _____.
qwelly [4]

Some people either add a shape as I do. But for this particular question it would be, either add word art or create a list with bullets. I would rather do word art or insert shape because that means you do not have to get the single bullet.


I really do hope this helped you. I hope you have a great day. And if I am incorrect I apologize.

3 0
3 years ago
Read 2 more answers
Any song recommendations, pls dont say 6ix9ine or lil pump
gogolik [260]

I actually do have one tho. Try Megan Tha Stallion.

8 0
3 years ago
Read 2 more answers
someone please do this for and send a screeshot or picture please its really important for my examsss :D​
dusya [7]

Answer:

I  dont know

Explanation:

i dont know

4 0
2 years ago
Other questions:
  • The force that pulls away from a curve is known as
    9·1 answer
  • A(n) _______________ CRM provides all users with the tools and information they need to fit their individual roles and preferenc
    14·1 answer
  • True or False<br><br> The signing of Act 26 made Cyber Harassment of a Child a crime.
    14·1 answer
  • Which one of the following, in addition to disciplinary programs and drug-testing, can employers misuse as a form of retaliation
    8·1 answer
  • Why is a personal laptop computer NOT a server?
    13·2 answers
  • What kind of word is the pronoun in bold letters?
    5·2 answers
  • The components of hardware include:
    6·2 answers
  • Which of the following is a good conductor of electricity and heat?
    13·2 answers
  • 15. Virus cannot infect files that are saved in i. USB ii. CD-ROMs iii. Memory card iv. All of them​
    14·2 answers
  • What's the biggest security issue with using social networking sites to market your listings?
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!