Monkey Business
A local zoo wants to keep track of how many pounds of food each of its three monkeys eats each day during a typical week. Write a
• Average amount of food eaten per day by the whole family of monkeys
• The least amount of food eaten during the week by any one monkey
• The greatest amount of food eaten during the week by any one monkey
Want to see the full answer?
Check out a sample textbook solutionChapter 8 Solutions
Starting Out with C++: Early Objects (9th Edition)
Additional Engineering Textbook Solutions
Absolute Java (6th Edition)
Starting out with Visual C# (4th Edition)
Using MIS (10th Edition)
Starting Out with Programming Logic and Design (5th Edition) (What's New in Computer Science)
Artificial Intelligence: A Modern Approach
Starting Out with C++ from Control Structures to Objects (9th Edition)
- (Electrical eng.) Write a program that specifies three one-dimensional arrays named current, resistance, and volts. Each array should be capable of holding 10 elements. Using a for loop, input values for the current and resistance arrays. The entries in the volts array should be the product of the corresponding values in the current and resistance arrays (sovolts[i]=current[i]resistance[i]). After all the data has been entered, display the following output, with the appropriate value under each column heading: CurrentResistance Voltsarrow_forward(Electrical eng.) Write a program that declares three one-dimensional arrays named volts, current, and resistance. Each array should be declared in main() and be capable of holding 10 double-precision numbers. The numbers to store in current are 10.62, 14.89, 13.21, 16.55, 18.62, 9.47, 6.58, 18.32, 12.15, and 3.98. The numbers to store in resistance are 4, 8.5, 6, 7.35, 9, 15.3, 3, 5.4, 2.9, and 4.8. Your program should pass these three arrays to a function named calc_volts(), which should calculate elements in the volts array as the product of the corresponding elements in the current and resistance arrays (for example ,volts[1]=current[1]resistance[1]). After calc_volts() has passed values to the volts array, the values in the array should be displayed from inside main().arrow_forward(Statistics) Write a program that includes two functions named calcavg() and variance(). The calcavg() function should calculate and return the average of values stored in an array named testvals. The array should be declared in main() and include the values 89, 95, 72, 83, 99, 54, 86, 75, 92, 73, 79, 75, 82, and 73. The variance() function should calculate and return the variance of the data. The variance is obtained by subtracting the average from each value in testvals, squaring the values obtained, adding them, and dividing by the number of elements in testvals. The values returned from calcavg() and variance() should be displayed by using cout statements in main().arrow_forward
- (Numerical) Write and test a function that returns the position of the largest and smallest values in an array of double-precision numbers.arrow_forwardUSE PYTHON A local zoo wants to keep track of how many pounds of food each of its three monkeys eats each day during a typical week. Stores this information in a two dimensional 3 × 7 array, where each row represents a different monkey and each column represents a different day of the week. First let the user input the data for each monkey then it should create a report that includes the following information: =>Average amount of food eaten by each monkey for the whole week. =>The least amount of food eaten during the week by any one monkey. =>The greatest amount of food eaten during the week by any one monkey.arrow_forwardProgramming Language: C++ Create a structure Student and ask the user how many students. Create an array which will save the number of students in the input. Ask for the data of the first and last student and display them.arrow_forward
- C++ language Write a program that asks the user to enter daily sale for five stores and record them in an array.The program should then display a bar graph comparing each store’s sales for all days of a week.Create each bar in the bar graph by displaying a row of asterisks. Each asterisk should representRs.1000 of sales. The program also calculates the total sale each day, and total sale of the week.Here is an example of the program s output.Enter day 1 sales for store 1: 4000 [Enter]Enter day 1 sales for store 2: 6000 [Enter]Enter day 1 sales for store 3: 10000 [Enter]Enter day 1 sales for store 4: 11000 [Enter] Enter day 1 sales for store 5: 3000 [Enter]Enter day 2 sales for store 1: 9000 [Enter]Enter day 2 sales for store 2: 8000 [Enter]Enter day 2 sales for store 3: 19000 [Enter]Enter day 2 sales for store 4: 7000 [Enter]Enter day 2 sales for store 5: 9000 [Enter]…(and so on.)Weekly SaleMonday: Total Sale: 34,000/-Store 1: **** (4000)Store 2: ****** (6000)Store 3: **********…arrow_forwardNumber Analysis Program (FYI: Pseudocode not any specific programming language.) Write a pseudocode algorithm that asks the user to enter a series of 20 numbers. The program should store the numbers in an array and then display the following data: The lowest number in the array The highest number in the array The total of the numbers in the array The average of the numbers in the arrayarrow_forwardarrayarrow_forward
- C programming using Arraysarrow_forwardProject 5 - Magic Squares Objectives The objective of this project is to have students practice with two-dimensional arrays and loops. Specifications In this project, you will write code to determine if a two-dimensional array of ints is a Magic Square. For a two- dimensional array of ints to be a Magic Square all of the following must be true: 1. The array must be square - in other words, the lengths of all rows and all columns must be the same. 2. The array must contain all integers from 1 to n*n, where n is the length of the rows and columns. 3. The sum of the numbers in each diagonal, each row, and each column must be the same. You have been given two classes: • MagicSquareTest.java - Contains JUnit test cases for the MagicSquare class. Your code must pass all these tests. • MagicSquare.java - contains static methods to determine if a two-dimensional array of ints is a Magic Square: o isMagicSquare() - returns true if a two-dimensional array of ints meets all the criteria to be a…arrow_forwardAn array can hold as much different data types as you want. True Falsearrow_forward
- Programming Logic & Design ComprehensiveComputer ScienceISBN:9781337669405Author:FARRELLPublisher:CengageC++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage LearningC++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology Ptr
- EBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENTProgramming with Microsoft Visual Basic 2017Computer ScienceISBN:9781337102124Author:Diane ZakPublisher:Cengage LearningMicrosoft Visual C#Computer ScienceISBN:9781337102100Author:Joyce, Farrell.Publisher:Cengage Learning,