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
X = 10<br> y = 20<br> x &gt; y<br> print("if statement")<br> print("else statement")
Eduardwww [97]
I dont really understand what you want to do but im gonna answer it as if I understood it.

If x is 10 and y is 20 then y is larger than x
8 0
3 years ago
Cloud architects have been largely replaced by ScrumMasters.<br><br> True<br><br> False
Kitty [74]
True much larger than scrum masters
6 0
3 years ago
Read 2 more answers
What is the flow of electrons called?
kondaur [170]

Answer:

Electricity is the flow of electrons through a conductor, usually in the form of a wire, this flow is called an electric current.

4 0
3 years ago
What does the statement that follows do? double gallons[6] = { 12.75, 14.87 }; a. It assigns the two values in the initializatio
Serhud [2]

Answer:

It assigns the two values in the initialization list to the first two elements and default values to the other elements.

Explanation:

Given

The array initialization

Required

Interpret the statement

double gallons[6] implies that the length/size of the array gallons is 6.

In other words, the array will hold 6 elements

{12.75, 14.87} implies that only the first two elements of the array are initialized ; the remain 4 elements will be set to default 0.

3 0
3 years ago
If a menu item requires additional information from the user, the Windows standard is to place a(n) ____ at the end of the capti
elena-s [515]

Answer:

elipses

Explanation:

According to my research on information technology, I can say that based on the information provided within the question the windows standard in this situation would be to place an ellipses at the end of the caption. This is because in the English language an ellipses (...)  usually indicates an intentional omission of a word or sentence, which in computer science is used to give the user an indication that it requires further user input.

I hope this answered your question. If you have any more questions feel free to ask away at Brainly.

4 0
4 years ago
Other questions:
  • Most documents are printed in ______ orientation
    9·2 answers
  • Which of these devices is usually the default for most home network?
    12·1 answer
  • A computer with a frequency 2 GHZ and its average cycle per instruction is 2. what is the MIPS of the computer?
    6·1 answer
  • Time complexity: Be sure to show your work. Suppose that a particular algorithm has time complexity T (n) = 10 ∗ 2n, and that ex
    7·1 answer
  • In which of the following situations should you expect to provide your Social Security number?
    13·1 answer
  • How does an individual's access to a wide range of online services affects their ability to operate safely in the digital world.
    5·1 answer
  • 1. How do you know that A Drop of Water is an expository<br> text? GENRE
    7·1 answer
  • What type of error occurred??
    10·1 answer
  • PLS FAST DONT EXPLAIN
    13·1 answer
  • What is the difference between cyberbullying and bullying.
    5·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!