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

  Number of new entries of parts in the application

The application should be able to count the number of automobile parts sold every week depending upon the number of new entries of parts in the application. If a part is not sold for more than six months after its date of manufacture, the applicat..

  Creating virtual computer using c programming language

I need help with creating virtual computer using c programming language, the program should exactly work like a real computer

  Write a program that asks the user to enter an integer

Write a program that asks the user to enter an integer between 1 and 15. If the number entered is outside that range, your program should print out an error message and re-prompt for another number.

  Pointer variables to demonstrate shallow and deep copy

Using C++, write a program that uses pointer variables to demonstrate shallow and deep copy. The program should give the user the choice to do the following:

  The private members of yclass are public members of xclass

Suppose that a class employeeType is derived from the class personType. Give examples of data and function members that can be added to the class employeeType.

  What happens throughout the eleven-day mourning

What happens throughout the eleven-day mourning period after Ashoke's death? How do friends express their sympathy? What kind of diet do Ashima, Gogol, and Sonia follow? What happens on the eleventh day itself?

  Write a pseudocode and draw flowchart for the program

Please help with a pseudocode and flowchart for the program, that follows the guidelines of good program design, like meaningful variable names and thoroughly commented code.

  Create the switch statement to implement set of conditions

Create the necessary switch statement to implement this set of conditions.

  Development team modify

The application used to calculate the cost of carrying additional luggage results in erroneous amount, if the weight of the luggage is a fractional number. Help the development team modify the code snippet so that the cost of carrying additional l..

  Write a program in which the program prints out

Use (switch statement) to write a program in which the program prints out the input (single character) if the character is not '2','t', or 'w'. Use 'default' and 'break' wisely.

  Memory values and a one-address machine with an accumulator

Given the following memory values and a one-address machine with an accumulator, what values do the following instructions load into the accumulator?

  Create a customer profile class.

a. Create a CustomerProfile class. Each CustomerProfile contains a last name, phone number, and bit fields indicating whether the customer:

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