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
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?
|