subject

Create and initialize a 5 x 5 array as shown below. 0 2 0 0 0 0 2 0 0 0 0 2 2 0 0 0 2 0 2 0 0 2 0 0 2 First, write a printArray() function that prints out the array. Use a single parameter in the definition of the function, and pass the array you created above as the parameter. Call the function so it prints the original array. Then write a flipHorizontal() function that flips the contents of the array horizontally and prints the result. This means that the values in each row should be reversed (look at the second array in the sample run of the program for clarity). Again, this function should pass the original array as the parameter. Within your flipHorizontal() function, call the printArray() function to print the new array that has been horizontally flipped. Reset the array back to the original 5 x 5 array we started with. Then write a flipVertical() function that flips the contents of the array vertically and prints the result. This means that the values in each column should be reversed (look at the third array in the sample run of the program for clarity). Again, this function should pass the original array as the parameter. Within your flipVertical() function, call the printArray() function to print the new array that has been vertically flipped. The sample run below shows how your code should print the original array, followed by the horizontally-flipped array, followed by the vertically-flipped array. Notice that the output below includes blank lines between each of the three arrays - yours should do the same. Sample Run 0 2 0 0 0 0 2 0 0 0 0 2 2 0 0

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 20:00
Amanda needs to create an informative print brochure for her local library’s fundraiser dinner. what critical detail must she have before she starts designing the brochure?
Answers: 1
question
Computers and Technology, 23.06.2019 13:00
Donnie does not have powerpoint. which method would be best for elana to save and share her presentation as is? a pdf a doc an rtf a ppt
Answers: 3
question
Computers and Technology, 23.06.2019 14:00
What is html ? give a small description about html
Answers: 2
question
Computers and Technology, 24.06.2019 13:30
Write a program that uses a two-dimensional array to store the highest and lowest temperatures for each month of the year. the program should output the average high, average low, and the highest and lowest temper- atures for the year. your program must consist of the following functions: a. function getdata: this function reads and stores data in the two- dimensional array. b. function averagehigh: this function calculates and returns the average high temperature for the year. c. function averagelow: this function calculates and returns the aver- age low temperature for the year. d. function indexhightemp: this function returns the index of the highest high temperature in the array. e. function indexlowtemp: this function retur
Answers: 3
You know the right answer?
Create and initialize a 5 x 5 array as shown below. 0 2 0 0 0 0 2 0 0 0 0 2 2 0 0 0 2 0 2 0 0 2 0 0...
Questions
question
Mathematics, 26.02.2021 20:00
question
Mathematics, 26.02.2021 20:00
Questions on the website: 13722363