Write a function to compute the average amount of food eaten

Assignment Help C/C++ Programming
Reference no: EM131014657

This program is in c++ how could I make the following changes?

Modify, do not rewrite, source.txt. In general, make the program as scalable as possible. "scalable"?, for this program, means that one can change the number of monkeys or changing the number of days the monkey are fed by changing the data file and one or two global constants.

1. Do not use any global variables. Global constants are ok.

2. Remove all 1D arrays from the program

3. Increase the number of monkeys from 3 to 32

4. Feed the monkey 7 days a week instead of 5

5. Use 2D arrays almost everywhere

6. Use 2D array parameters almost everywhere

7. Write a function to compute the average amount of food eaten per day by the whole family of monkeys; write a function to compute the least amount of food eaten by any monkey; write a function to compute the most amount of food eaten by any monkey.

8. Read the monkey data from a file rather than interactively. Your file will contain 32 x 7 = 224 integers. Write a function to read the data from a file. Make sure the data is good. Define sensible upper and lower bounds for monkey daily monkey food consumption.

Attachment:- Source.txt

Reference no: EM131014657

Questions Cloud

Data calculate the after-tax cash flow : Given the following data calculate the after-tax cash flow. Sales $389,000, cost of goods sold $200,000, taxes $108,000, interest $45,000, operating expenses $67,000, depreciation $50,000, net income $39,000.
Dividends are expected to grow-hat is current share price : Synovec Co. is growing quickly. Dividends are expected to grow at a rate of 24 percent for the next three years, with the growth rate falling off to a constant 7 percent thereafter. If the required return is 11 percent, and the company just paid a di..
Jacobi company balance sheet was the following shareholders : Total contributed capital, retained earnings, and accumulated other comprehensive income xxxxx
Write a function that models the total population : Write a function that models the total population for the years shown in the bar graph - Does the result in part (b) overestimate or underestimate the actual total population in 2005 shown by the bar graph? By how much?
Write a function to compute the average amount of food eaten : Write a function to compute the average amount of food eaten per day by the whole family of monkeys; write a function to compute the least amount of food eaten by any monkey.
Business in a culture that was opposite : 1. If you were planning to do business in a culture that was opposite from your own on the cultural dimensions of "power distance" and "individualism/ collectivism," what challenges would you expect to face? How would you prepare?
Information about business ethics : Imagine that someone from another culture asked you to provide information about business ethics when dealing with American managers. What would you say?
Find probability that supply chain broken in event : Consider the relief supply chain infrastructure for a main island in the event of flood disaster illustrated by Figure. Suppose that the probabilities that links 1 and 2 are destroyed in the event of a flood are 0.03 and 0.07, respectively. Find t..
How you would go about the entire sequence of systems design : You are asked to design a pedestrian footbridge over a busy street in a city's downtown area. What are some of the structural engineering considerations that need to be taken into account during the design of this system?

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Evaluate the expression

How many times will "jump" be displayed in the following program segment? If the loop doesn't terminate, write "infinite" Evaluate the expression.

  Add 10 people to the line

Add 10 people to the line and process them. Each time you process someone, print out their ticket information. After all 10 have been serviced, print the average wait time. Below is an example of the time calls you will need and a wait function.

  An assembly program to determine the price of a car rental

an Assembly program to determine the price of a car rental

  Write two short c programs and solve four exam-style

write two short c programs and solve four exam-style problems. details on the programs are as follows.program

  Calculates different formulas that converge to the number pi

Write a C program (Care should be taken not to use extensions of C + + language in your work ) that calculates different formulas that converge to the number  pi,  to compare the speed of convergence of these formulas. Each form will be calculated by..

  Program that generates 50,000 random integers

Program that generates 50,000 random integers from 1 to 6 (inclusive). Count the number of times that each number occurs and output the totals

  Write a program in c of fibonacci series

Write a program in c of Fibonacci series with and without using fibo func, both

  Write a program in c that arranges and prints out

When playing poker and other card games (standard 52 cards, excluding the jokers), it is usual to arrange a hand to reflect its values. Write a program in C that arranges and prints out a random hand of ten cards in sorted order by pips values.

  Lab9 c lab 9 c i request this twice but no answer on this

lab 9 c ltbrgti request this twice but no answer on this please could you check this for

  Compute the average of each row

Write a program that prompts the user to enter 15 double numbers from the keyboard and save them into a 3 by 5 array in the main ( ). Then call a user-define function to compute the average of each row and print the original matrix and average of ..

  The funtion should take as parameters

Write a function in c ++ that multiplies two functions. the funtion should take as parameters two fraction structures. Then, the function should multiply the two fractions and return the solution as a fraction structure.

  Reads numbers from input and prints them in reverse order

Write a C program that reads ten numbers from input and prints them in reverse order. We assume that the data consists of integers. The program should conform to the following format:

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd