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
Zigmanuir [339]
3 years ago
10

Add an array, which will store the most recent 5 recent transactions. For the array, add an insert function which will store the

specified transaction. You will need a index-counter which will keep track of the available index. If more than 5 are stored, it should loop around.
Computers and Technology
1 answer:
Vika [28.1K]3 years ago
4 0

The answer & explanation for this question is given in the attachment below.

Download docx
You might be interested in
eocs can be fixed locations, temporary facilities, or virtual structures with staff participating remotely.
levacccp [35]

EOCS can be fixed locations, temporary facilities, or virtual structures with staff participating remotely is a true statement.

<h3>What is the Emergency Operations Centers (EOC)?</h3>

Emergency Operations Centers is known to be part of the four NIMS Command and Coordination structures as the EOCs are known to be used  in an off site locations where staff are gotten from a lot of agencies that come together to address some imminent kind of threats and hazards.

Therefore saying that EOCS can be fixed locations, temporary facilities, or virtual structures with staff participating remotely is a true statement.

Learn more about EOCS from

brainly.com/question/10794095

#SPJ1

5 0
1 year ago
1D Array Assignment Outcome: Student will demonstrate the ability to use a one-dimensional array. Student will demonstrate the a
sukhopar [10]

Answer:

Program to this question as follows:

program:

import java.util.*; //import package for user input

public class Main  //defining class  

{

public static void main(String[] as)//defining main function

{//defining integer array

int [] num = new int[113];  

boolean find_in = false; //defining boolean variable

int [] counts = new int[101];//defining integer array

int y, tem = 0, counter = 0,in=0,x,find; //defining integer variable

Scanner ox= new Scanner(System.in); //creating Scanner class Object

while(counter <= 112) //loop to check condition

{

num[counter++] = generateRandomNumber(); //using array to hold random function value.  

}

System.out.println("The array:"); //message

for(x = 0; x < 112; x++) // loop to count the value

{

if(x != 0 && x % 9 == 0) // if block to chek value

System.out.println(); // print  

else

System.out.print(num[x] + " "); // print array

}

// sort in ascending order

Arrays.sort(num); //using sort method

System.out.print("\n\nThe array in sorted order:"); // print value

for( x = 0; x < num.length; x++) // loop uses if block to check value is divisiable by 9  

{

if(x % 9 == 0) //check condition  

System.out.println(); // print  

else

System.out.print(num[x] + " "); // print array

}

// search for a number

System.out.print("\n\nEnter a number to search: "); // print message

find= ox.nextInt(); // input number by user

for(x= 0;x< num.length;x++) //loop to count values

{

if(num[x] == find) //check value

{

find_in = true; //change value

in= x;

break; //using break keyword

}

}

if(find_in)  //find value

System.out.println(find + " is found at index " + in); // print location

else

System.out.println("Not found"); //message

// display count of each numbers

System.out.println("Count of each numbers:"); //message

for(y = 1; y< num.length; y++) // loop to store element in counts array  

{

tem = num[y]; //hold value

counts[tem]++; //increment value

}

for(x = 1; x< counts.length; x++) //loop to print value

{

System.out.println(x + ": " + counts[x]); // print value

}

// average of the numbers in the array

for(x = 0; x < num.length; x++) // loop to calculate sum and average

{

sum += num[x]; //calculate sum

}

avg = (sum / 100); // calculate avg

System.out.println("\nThe average of the numbers in the array: " + avg);

// highest number in the array

int high= num[0]; //find number

for(x= 0;x < num.length;x++)

{

if(num[x] > high)

high = num[x]; //hold value of highest Number

}

System.out.println("\nThe highest number is: " + high); //print value

int low = num[0]; // defining variable for lowest number

for(x= 0; x < num.length - 1; x++) // loop to calculate lowest number

{

if(num[x] < low) //condition for lowest number

low = num[x]; //hold lowest number

}

System.out.println("\nThe lowest number is: " + low); //print value

}

public static int generateRandomNumber() //defining function  

{

Random ra = new Random(); //creating Random function Object

return (ra.nextInt(100)+ 1); //input and return value

}

}

Output:

the output of the given code is display in image

Explanation:

In the above program, an array is declared that uses a random function to input the number, in the next step the sort function is used, that sorted all array elements, in the next step the scanner class is used, that input the number form the user ends and pass search in the sorted array.

  • After searching the average of array elements is calculated. In this array we calculate the highest and lowest number of the array to print all the values the print method is used.
  • At the last, the rand method is used that generates the random number for the array and passes into a num array that prints the values.

7 0
3 years ago
The following method in Inventory is intended to count how many batteries are fully charged. What should replace /*Missing Code
OverLord2011 [107]

Trees are the most important part of our environment. They are having a direct impact on our lives. We can’t breathe except the existence of trees in the world. They leave the most important thing oxygen for us. But it is a matter of sorrow that day by day, the tendency of deforestation has been increased in the peak. It has been a matter of afraid now.

Due to the high tendency of deforestation, the world is lacking enough amount of oxygen. We need to plant more and more trees to make it normal. We have seen lots of examples that the world will face a hard time except for the existence of trees. Already, lots of species of trees have been extinct.

To fight against all the environmental odds, we need to grow more trees. The best time of growing trees is the rainy season. The soil has the best capacity to grow trees in this season. Trees have lots of uses for our regular life. We can make money and maintain our life with it. It is the biggest source of food.

If you plant lots of fruit trees, you can make a business on it. From today, we all need to start planting more and more trees.

4 0
3 years ago
A company is looking for an employee to assign passwords to all of its
d1i1m1o1n [39]

Answer:

B. Information security analysis.

Explanation:

8 0
2 years ago
How does the occupational outlook affect the monetary benefits of a career
Ksivusya [100]
If there are changes to the responsibilities in a career, the typical outcome will change.
4 0
3 years ago
Other questions:
  • A collision volume is called ____
    7·1 answer
  • I need the code for Assignment 5 Animation in Edhesive, its in python code.
    9·1 answer
  • python Write a program that will take a file named Celsius.dat that contains a list of temperatures in Celsius (one per line), a
    9·1 answer
  • Write a function that, given an array A of N integers, of which represents loads caused by successive processes, the function sh
    15·1 answer
  • Why is plastic durable?
    9·2 answers
  • The duties of a database administrator include determining which people have access to what kinds of data in the database; these
    13·2 answers
  • You want to be able to identify the services running on a set of servers on your network. Which tool would best give you the inf
    11·1 answer
  • Reading (BCK FORM 2C IT 2020-2021)
    12·2 answers
  • Which Internet connection type tends to use shared bandwidth?<br> Cable<br> Dial-up<br> DSL<br> ISDN
    5·2 answers
  • !!! PLEASE HELP ASAP REALLY NEED IT !!!
    15·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!