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 are writing an email to a potentional employer about a job opportunity. What can you do to make sure the email reflects your
Lina20 [59]
You want to use proper etiquette and be polite, do not call them by their first name and always refer to them as Mr., or Mrs. Use an extended vocabulary and do not talk about yourself.  If you have proper grammar, depending on the job, that can be seen as intelligence. And always use an appropriate closing that is respectful. Such as, Sincerely, John Doe.
4 0
4 years ago
Read 2 more answers
. Reorder the following efficiencies from smallest to largest:
alexdok [17]

Answer:

The order of the efficiencies is as following:-

10,000 < 2n < nlog(n) < n5 < n!.

Explanation:

10,000 is constant time whatever will be the size of the problem the efficiency will remain the same.

2n this efficiency is linear it will grow proportionally as the size of the problem increases.

nlog(n) this efficiency is is a bit greater than 2n though it will grow faster than 2n but slower than n2 as the size of the problem increases.

n5 this efficiency is very poor.It is growing very rapidly as the size of the problem increases.

n! is the worst efficiency of them all.

n!=n*(n-1)*(n-2)*(n-3)*(n-4)*.......2*1.

It will grow beanstalk in jack and the beanstalk.

3 0
3 years ago
Which of the following types of advertising is the most difficult for consumers to ignore?
ICE Princess25 [194]
There are many types of advertisements to entice people and persuade them to buy a product some of these include Info-mericals, Celebrity Appeal and Bandwagon for example.

But the MOST difficult to ignore is Product Placement  
5 0
4 years ago
Read 2 more answers
The Horse table has the following columns:
dimulka [17.4K]

See below for the statement to insert the data values

<h3>How to insert the records?</h3>

To do this, we make use of the insert statement.

This is done using the following syntax:

INSERT INTO table_name (column_name, ...) VALUES (value, ...)

Using the above syntax and the data values, we have the following insert statement.

INSERT INTO Horse (RegisteredName, Breed, Height, BirthDate)

VALUES ('Babe Quarter', 'Horse', '15.3', '2015-02-10'), ('Independence', 'Holsteiner', '16.0', '2017-03-13'), ('Ellie', 'Saddlebred', '15.0', '2016-12-22')

INSERT INTO Horse (Breed, Height, BirthDate) VALUES ('Egyptian Arab', '14.9','2019-10-12')

Read more about SQL at:

brainly.com/question/10097523

#SPJ1

4 0
2 years ago
Why are the keys on the qwerty keyboard arranged the way they are?
sveticcg [70]
Sholes arranged the keys in their odd fashion to prevent jamming on mechanical typewriters by separating commonly used letter combinations.
7 0
3 years ago
Other questions:
  • Write the interface (.h file) of a class GasTank containing: A data member named amount of type double. A data member named capa
    13·1 answer
  • Write a C++ program that reads students' names followed by their test scores. The program should output each students' name foll
    9·1 answer
  • In order to delete an object, it must be?
    14·1 answer
  • State three differences between a hard drive and a pen drive​
    6·1 answer
  • Which keyboard feature is a form feed character?
    15·1 answer
  • Acts as a platform on which application software runs?
    6·1 answer
  • Compare the specialized and statistical functions in excel
    10·1 answer
  • Free 100 point to first to answer
    5·2 answers
  • What are the advantages of Napier bones?​
    15·1 answer
  • Hello Answerers it would be great if you could answer this:
    12·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!