Implement the ArrayMethod application containing an array that stores eight integers. The application should call the following five methods: 1. display - should display all the integers 2. displayReverse - should display all the integers in reverse order 3. displaySum - should display the sum of the integers 4. displayLessThan - should display all values less than a limiting argument 5. displayHigherThanAverage - should display all values that are higher than the calculated average value.

Answers

Answer 1

Answer:

public static void display(int [] arr){

   System.out.print("Arrays: ");

       for(int i =0;i<arr.length;i++){

           System.out.print(arr[i]+" ");

       }

       System.out.println();

   }

   

public static void displayReverse (int [] arr){

   System.out.print("Arrays in reverse order: ");

       for(int i=arr.length-1;i>=0;i--){

           System.out.print(arr[i]+" ");

       }

       System.out.println();

   }

   

public static int displaySum (int [] arr){

   System.out.print("Sum: ");

   int sum = 0;

       for(int i =0;i<arr.length;i++){

           sum+=arr[i];

       }

       return sum;

   }

   

public static void displayLessThan (int [] arr, int num){

       System.out.print("Less than "+num+": ");

       for(int i =0;i<arr.length;i++){

           if(arr[i]<num){

               System.out.print(arr[i]+" ");

           }

       }

       System.out.println();

   }

public static void displayHigherThanAverage  (int [] arr){

       System.out.print("Higher than average: ");

       int sum = 0;

       for(int i =0;i<arr.length;i++){

           sum+=arr[i];

       }

       float average = sum/arr.length;

       for(int i =0;i<arr.length;i++){

           if(arr[i]>average){

               System.out.print(arr[i]+" ");

           }

       }

       System.out.println();

   }

Explanation:

The methods were written in Java. See attachment for explanation where I used comments to explain each lines.

Note that lines that begin with double slash (//) are comments


Related Questions

Why should you try out a camera bag before taking it on a vacation?

So you can make sure that your passport fits in it
So that you can make sure it is comfortable
So that you can get a different color
So that you can add more equipment

Answers

Answer:

b or c

Explanation:

I think it’s B but I could also be c

PLEASE HELP ME WITH THIS i will mark you brainlist

Answers

Answer: you have to check your email and click on the microsoft email they sent you and enter the code in the email.

Explanation: plz mark brainliest

Which of the following guidelines about the subject line of e-mail messages is most appropriate?


1: Avoid using a subject line unless the e-mail is very important.

2: Use the subject line wisely to let your reader know the main purpose of the e-mail.

3: Try to keep the subject line very short, such as just one or two words.

4: Make sure you provide all the details in the subject line in case the receiver does not have time to read the whole e-mail.

Answers

Answer: 2: Use the subject line wisely to let your reader know the main purpose of the e-mail.

============================================================

Explanation:

The subject line is like the title of a book. You want to give a quick sense of what the email is about, but you also don't want to put the entire contents of the book in the title. The subject line only has so much room. Even less room is available if the reader is checking their email on their mobile device.

Choice 1 is false because subject lines are important. I can't think of a case where you can omit the subject line entirely (ie leave it blank), unless it's a situation where the recipient knows in advance what the topic is about. Though that may be rare.

Choice 3 is false. Yes you want to keep the subject line short, but you also don't want to be cryptic or confusing. If you can get away with using 1 or 2 words, then go ahead and do so. However, you may need more words to convey the topic of the email. Go with what feels right and try to put yourself in the shoes of the person reading your email. Ask yourself "Does this convey the message I want to send?"

Choice 4 is false. As mentioned, you do not want to put the entire email in the subject line. The exception of this rule is that if the email is really really short. For every other case, you should have a fairly short title and then go over the details in the email main body itself.

Answer:

Use the subject line wisely to let your reader know the main purpose of the e-mail.

Explanation:

i got it right on edge 2021

what percent of records are temporary, if you are not in the OSD?​

Answers

Answer:

Headed by the OSD Records Administrator, the OSD Records and Information Management (RIM) Program is responsible for oversight, implementation of the Federal Records Act within the Offices of the Secretary of Defense and the WHS supported Defense Agencies and Field Activities.

Explanation:

List two panels that allow you to adjust the properties of your titles.

Answers

Answer:

1. The tools panel

2. The actions panel

Explanation:

The tools panel contains properties that allow for text and object creation. The actions panel contains properties that allow for the alignment and distribution of titles.

Under the tools panel, we can find properties like; line, arc, an arrow for selection, different shapes like rectangle and the clipped corner, vertical type, vertical area type, vertical path type, etc. Under the actions panel, properties like; align, center, and distribute can be found.

The ‘rect()'block has two inputs that
control where it's drawn - the x and y position. If
you wanted these commands to draw different
sizes of rectangles, what additional inputs would
you need to give the blocks?

Answers

Answer is yes beacause

The w and h, which are the width and height respectively, are additional inputs that should be given to the block to draw rectangles of different sizes.

In the Drawing drawer of the Game Lab toolbox, the rect() command is used for drawing a rectangle. It takes in four inputs as arguments. These arguments are;

i. x - the x-coordinate of the point relative to the top-left corner of the display area where the shape will begin from. This is the first argument.

ii. y - the y-coordinate of the point relative to the top-left corner of the display area where the shape will begin from. This is the second argument.

iii. w - the width of the rectangle to be drawn. This is the third argument. It is measured in pixels.

iv. h - the height of the rectangle to be drawn. This is the fourth argument. It is measured in pixels.

For example, to draw a rectangle with a height of 50px, width of 60px and starting at point (x, y) = (40, 40), the command rect() will be called as follows;

rect(40, 40, 60, 50)

Take a look at another example: To draw a rectangle with a width of 120px, height of 60px and starting at point (x, y) = (30, 50), the command rect() will be called as follows;

rect(30, 50, 120, 60)

Therefore, the width and height inputs should be specified in order to draw different sizes of rectangles.

i need help with this ​

Answers

Answer:

Answer is D

Explanation:

cameras did not use disks until the late 1990s  :D

edit: sorry my previous answer was wrong, I apoligize for the mishap :(

The executive ________ is the person ultimately responsible to their company for the project's success.

fill in blank

Answers

Answer:

Manager.

Explanation:

Just thank me later and make sure to click the crown at the top of this answer ;)

Answer:

sponsor i took the test

Explanation:

Usually senior executives, executive sponsors, are the ones ultimately responsible to their company for the project's success.

PLEASE HELP ITS CODING AND I INCLUDED A SCREENSHOT OF WHAT TO DO

Answers

def even_checker(lst):

   for x in lst:

       if x%2==0:

           print(x)

l = [1,2,3,4,5,6,7,8,9,10]

even_checker(l)

I wrote my code in python 3.8. I hope this helps.

Elza hos a document with plain text. She wants to format only the second paragraph of the fifth page to have two
columns. What sequence of buttons will Eliza click to set up the correct type of section break for this?
O Page Layout, Breaks, Page
O Page Layout, Breaks, Continuous
Insert, Page Break
O Insert, Continuous

Answers

Page layout breaks page

Question # 2
Dropdown
Identify the type of error described.

___5 / 0


___ float('two')

Answers

Answer:

ZeroDivisionError

ValuError

Explanation: Edg 2020-2021

Answer:

1.ZeroDivisionError

2.ValueError

Explanation:

took test

Write a program that uses an initializer list to store the following set of numbers in an array named nums. Then, print the array.

14 36 31 -2 11 -6

Sample Run
[14, 36, 31, -2, 11, -6]

Answers

Hope it will help you

PLZZ HELPP MEE!!

What projects would Excel best be used for? Be sure to say the name of the project and how you would go about creating it.

Answers

In my opinion, I believe Excel would be best used for any project really. But it will be most helpful when it comes down to reports and finance data and things like that. I would do something like how much income will I receive over the next few months to a year. And I will create a graph sowing my income for each month. But like I stated earlier, Excel is mainly used for graphs and almost every project has a graph so, it would actually be good for all things.

Hope this helps! :))

V. Write a program in python for the following:
[10]
a) Jennifer wants to carpet her new room with pink carpet. Create a program that will ask the user for the two
dimensions of a room (length and width) and then calculate the area of the room, (length x width), before
finally displaying the answer​

Answers

Answer:

length = input("length of room:  ")

width = input("Width of room:  ")

Area = float(length) * float(width)

print("Area of room is: ", Area)

to display “ hello ” message on the screen

Answers

Answer:

hello like that

it's in order

Use the drop-down menus to complete statements about archiving and backing up data fileArchiving data files manages the size of a mailbox for storage.
Creating an Outlook data file
data files in storage on a computer.

Answers

Answer:

Archiving data files manages the size of a mailbox for  

local

storage.

Creating an Outlook data file  

protects

data files in storage on a computer.

Explanation:

Because its right.

Answer:

an increase in cloud computing

Explanation:

Numerical methods are implementations of mathematical algorithms, but constructed with special consideration for accuracy of solutions and computational run-time. The order in which we implement floating point arithmetic for any numerical method will effect the accuracy of the final computed value. For this reason, extra thought must be placed on our basic mathematical operations. In this problem, you are asked to add-up the values in a large array called data. How should you do this to achieve the most accurate final sum

Answers

Answer:

find detailed description of algorithms (direct and iterative methods) in books [8], [3], [24]. We limit ourself to only selected problems and methods which are important in chemical engineering. 1.2.1 Conditioning of a system of linear equations We do not compute accurately because of rounding errors, which affect results of calcu-lations.

Explanation:

pdf
B. Ayusin ang mga titik sa bawat bilang upang mabuo ang mga
tamang salita na bumubuo ng web browser at mga ilang
bahagi ng web browser. Isulat ang iyong sagot sa sagutang
papel.
1. terterin ploexrer
2. glegoo mechro
3. foxfire zillamo
4. bat mena
5. bat wen​

Answers

Answer:

Question wants the misspelled words to be properly arranged to give the correct names in relation to web browsers.

terterin ploexrer ⇒ Int-ernet Ex-plorerglegoo mechro ⇒ Goo-gle Ch-romefoxfire zillamo ⇒  M-o-z-i-l-l-a Fire-foxbat mena ⇒ Tab name.bat wen​ ⇒ New Tab

Please help,it’s a year 9 question

Answers

Answer:

For an AND gate, Q would be 0,0,0,1 respectively.

See the reference table below.

An algorithm to print a set of 10 integers in ascending order

Answers

Answer:

Program  - Array Sorting

Author   - Vishal Solanki

Language - C Language

Date     - 03/02/2018 (dd/mm/yyyy)

*/

//IDE used for this code is "Visual Studio 2017"

#include <stdio.h>              //including stdio.h for printf and other functions

#include<conio.h>

int main()                        //default function for call

{

int a[100],n,i,j;

printf("Array size: ");

       scanf("%d",&n);

       printf("Elements: ");

       

     for(i=0;i<n;i++)

   {

       scanf("%d",&a[i]);

   }

for (int i = 0; i < n; i++)                     //Loop for ascending ordering

{

 for (int j = 0; j < n; j++)             //Loop for comparing other values

 {

  if (a[j] > a[i])                //Comparing other array elements

  {

   int tmp = a[i];         //Using temporary variable for storing last value

   a[i] = a[j];            //replacing value

   a[j] = tmp;             //storing last value

  }  

 }

}

printf("\n\nAscending : ");                     //Printing message

for (int i = 0; i < n; i++)                     //Loop for printing array data after sorting

{

 printf(" %d ", a[i]);

}

for (int i = 0; i < n; i++)                     //Loop for descending ordering

{

 for (int j = 0; j < n; j++)             //Loop for comparing other values

 {

  if (a[j] < a[i])                //Comparing other array elements

  {

   int tmp = a[i];         //Using temporary variable for storing last value

   a[i] = a[j];            //replacing value

   a[j] = tmp;             //storing last value

  }

 }

}

printf("\n\nDescending : ");                    //Printing message

for (int i = 0; i < n; i++)                     //Loop for printing array data after sorting

{

 printf(" %d ", a[i]);                   //Printing data

}

return 0;          //returning 0 status to system

getch();

}

//Ouput

/*

Array size: 10

Elements :  3  4  7  6  5  1  2  8  10  9

Ascending :  1  2  3  4  5  6  7  8  9  10

Descending :  10  9  8  7  6  5  4  3  2  1

*/

Explanation:

The objective of this task is to use Scapy to estimate the distance, in terms of number of routers, between your VM and a selected destination. This is basically what is implemented by the traceroute tool. In this task, we will write our own tool. The idea is quite straightforward: just send an packet (any type) to the destination, with its Time-To-Live (TTL) field set to 1 first. This packet will be dropped by the first router, which will send us an ICMP error message, telling us that the time-to-live has exceeded. That is how we get the IP address of the first router. We then increase our TTL field to 2, send out another packet, and get the IP address of the second router. We will repeat this procedure until our packet finally reach the destination. It should be noted that this experiment only gets an estimated result, because in theory, not all these packets take the same route (but in practice, they may within a short period of time). The code in the following shows one round in the procedure. a = IP() a.dst = ’1.2.3.4’ a.ttl = 3 b = ICMP() send(a/b) If you are an experienced Python programmer, you can write your tool to perform the entire procedure automatically. If you are new to Python programming, you can do it by manually changing the TTL field in each round, and record the IP address based on your observation from Wireshark. Either way is acceptable, as long as you get the result.

Answers

Answer:

answer b

is correct

Is the current month 12?

Answers

No it currently month 2 February have a nice day:)

Give
25
Input devices examples

Answers

Keyboard
Microphone
Mouse
Pen
Image scanner
Touch pad
Light pad

A company is developing a smart TV that connects to a wireless home network. Which technology can best help to establish this connection?
Bluetooth
Infrared
C.
WI-FI
D
Internet of things
E
satellite

Answers

C wifi A company is developing a smart TV that connects to a wireless home network. Which technology can best help to establish this connection?
Bluetooth
Infrared
C.
WI-FI
D
Internet of things
E
satellite

A company is developing a smart TV that connects to a wireless home network. Which technology can best help to establish this connection?

C. Wi-Fi.

JAVA 6.37 LAB: Even/odd values in an array Write a program that reads a list of integers, and outputs whether the list contains all even numbers, odd numbers, or neither. The input begins with an integer indicating the number of integers in the list. The first integer is not in the list. Assume that the list will always contain less than 20 integers. Ex: If the input is: 5 2 4 6 8 10 the output is: all even Ex: If the input is: 5 1 -3 5 -7 9 the output is: all odd Ex: If the input is: 5 1 2 3 4 5 the output is: not even or odd Your program must define and call the following two methods. isArrayEven() returns true if all integers in the array are even and false otherwise. isArrayOdd() returns true if all integers in the array are odd and false otherwise. public static boolean isArrayEven(int[] arrayValues, int arraySize) public static boolean isArrayOdd(int[] arrayValues, int arraySize)

Answers

Answer:

Explanation:

Hey,

I an sorry I do not know java only python

Thanks

I need help also this counts as my second giveaway and last for today
Btw I give tons of points so you wanna answer Don't steal points

Answers

Answer: Visual Card

Explanation: Because it’s graphics, it means the visual of the game

Our tests will run your program with input 2, then run again with input 5. Your program should work for any input, though.

Write code that outputs variable numDays. End with a newline

Answers

Answer:

In Python:

numDays = int(input("Days: "))

print("Number of days: "+str(numDays)+"\n")

Explanation:

The program was written in Python and the explanation is as follows;

First, get the input for the number of days from the user

numDays = int(input("Days: "))

Next, print string "Number of days: " followed by the number input from the user and then newline

print("Number of days: "+str(numDays)+"\n")

The character \n represents new line

Q1: Identify and correct the errors in each of the following pieces of code. [Note: There maybe more than one error in each piece of code. a) int x = 1, total; while (x <= 10) { total += x; ++x; } b) while (x <= 100) total += x; ++x; c) public class Mystery { public static void main(String[] args) { int x = 1; int total = 0; while (x <= 10) { int y = x * x; System.out.println(y); total += y; ++x; }// end of while System.out.printf("Total is %d%n", total); }//end of main }//end of class Mystery2 *********************** Q2 What does the following program print? public class Mystery3 { public static void main(String[] args) { int row = 10; while (row >= 1) { int column = 1; while (column <= 10) { System.out.print(row % 2 == 1 ? "<" : ">"); ++column; }// end of while column<=10 --row; System.out.println(); }//end of while }//end of main }// end of class Mystery3

Answers

Answer:

a. int x = 1, total = 0;

while (x <= 10){

 total += x;

 ++x;

}

b. while (x <= 100){

 total += x;

 ++x;

}

c. public class Mystery{

 public static void main(String[] args){

   int x = 1;

   int total = 0;

   while (x <= 10){

     int y = x * x;

     System.out.println(y);

     total += y;

     ++x;

   }

   System.out.printf("Total is %d%n", total);

}

Explanation:

For the first code, the variable "total" was not initialized, so to avoid raising an error message, an integer value must be assigned to it before the increment. Code block two of the second while statement must be enclosed in curly braces, while the third code must be indented properly.

IN WHICH COUNTRY DO THEY LET YOU PLAY MINECRAFT IN SCHOOL?

Answers

Answer:

Sweden or Wales maybe?

Explanation:

Hope this helps!

Answer:

America if you play in secret

Explanation:

Select the correct answer.
A computer using a connectionless network protocol sends too many data packets to another computer, causing loss of a few packets. As a result, the message appears jumbled to the user at the destination computer. How does TCP overcome this issue?
A.
by using flow control
B.
by using cables
C.
by using terminals
D.
by using a larger IP address
Please only answer if you are 100% sure

Answers

Answer:

D by using a larger IP address correct

Explanation:

Correct answer I hope this helps you :)

Other Questions
Please help me with these questions Ill give you brainliest if you help with all questions had six wivesfather of Elizabethwas refused a divorce by Pope Clement VIIfounded the Church of EnglandAll of these describeA)Henry VIIIBCharlesJohn CalvinDMartin Luther If you want your life to be color full eat crayons Which example is NOT a chemical change? *A. Hydrogen peroxide bubbles in an open wound on your skin.B. Piece of pizza digested when eaten.C. Rotting Easter eggs. .D. Dissolving salt in water. How did the Ottoman Empire follow the Byzantine Empire? Elliott is trying to normalize a database that he has designed. Which is not one of the elements of 1NF or 2NF?Each cell of a table must contain a single value.The table must not contain repeating groups.Each table must depend on the entire primary key.Each table must depend on the entire foreign key. What is the function of the circulatory system shown?to break down and release nutrients from foodto send and receive messagesto exchange gases with the atmosphereto carry oxygen and nutrients to cells and remove waste products if you know what is a pie find x. PLSSSS HELP HURRYYY !! The sum of twice a number and 4 times another number is 4. The difference of the numbers is 5. Find the numbers(help a sis out) What architectural movement is a parallel to the Bauhaus?1) Gothic2)Post Modernism3)Constructivism4)Modernism Evaluate g(x)=3x when x=-2,0and 5 Describe the Japanese response to internment. 5.) The caste system was first put in place in India thousands of years ago. Which of the following describes the caste system?a. It is a system that treats certain people inferior to othersb. You cannot be removed from your caste, no matter what you doc. Your children will be in the same caste that you ared. All of the above are true Help help chem question Find sin D and sin E. Write each answer as a fraction and as a decimal. Round to four decimals places. which Washington region is dominated by one of the longest rivers in the world? please someone help me, will give brainily Why is the French Revolution so different from the previous revolutions? A scientist is testing a new antibiotic on some bacteria she discovers the the antibiotic kills half of the Bactria every hour if she starts with 42000 bacteria what equation can be used to predict the number of bacteria after x hoursa). y= 42000(2)^xb). y=42000(1/2)^xc). y=42000(1.5)^xd). y=(42000/2)^x