#include<bits/stdc++.h>
using namespace std;
int main(){
int arr[3][7],i,j;
float total=0;
int min_food=INT_MAX,min_day,min_monkey,most_food=0,most_day,most_monkey;
string day[7]={"Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"};
cout<<"Enter food value in pound : \n";
for(i=0;i<7;i++){
for(j=0;j<3;j++){
while(1){
cout<<"Enter food eaten by #"<<(j+1)<<" monkey on "<<day[i]<<" : ";
cin>>arr[j][i];
if(arr[j][i]<0){
cout<<"invalid input please re-enter : \n";
continue;
}
total+=arr[j][i];
if(arr[j][i]<min_food){
min_food=arr[j][i];
min_day=i;
min_monkey=j+1;
}
if(arr[j][i]>most_food){
most_food=arr[j][i];
most_day=i;
most_monkey=j+1;
}
break;
}
}
}
cout<<"Average food eaten by monkey family each day : "<<total/7<<" pound\n\n";
cout<<"The least daily food consumed by monkey #"<<min_monkey<<" on "<<day[min_day]<<" : "<<min_food<<"\n\n";
cout<<"The most daily food consumed by monkey #"<<most_monkey<<" on "<<day[most_day]<<" : "<<most_food<<"\n\n";
return 0;
}
for any query please comment.
please upvote if find it helpful.
Thank you!
Pseudocode please Special Problem for Swap A local zoo wants to keep track of how many...
C++ 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 program that stores this information in a two-dimensional 3 × 5 array, where each row represents a different monkey, and each column represents a different day of the week. The program should first have the user input the data for each monkey. Then, it should create a report that includes...
In java 1. Monkey Business (10 points) 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 program that stores this information in a two-dimensional 3 x 5 array, where each row represents a different monkey and each column represents a different day of the week. The program should first have the user input the data for each monkey. Then, it should create...
In C++ Rewrite Modularity section to clarify functions should be separate. Assignment 6 - Monkey Food In the Gaddis textbook read Chapter 8 sections 8.1-8.9 before starting this assignment. This assignment is Programming Challenge 4 from Chapter 8 of the textbook. 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 program that stores this information in a two-dimensional 3 x 7 arrray,...
Your professor is hoping to get a summer job flipping burgers at the local burger joint. His starting salary will be $7.25 per hour. However, there are certain incentives to encourage him to work extra hours. It is calculated as follows per day: •$7.25 for the first 6 hours he works per day, Monday through Friday .•$8.25 for the next 2 hours he works per day, Monday through Friday. •$11.25 for each hour he works over 8 hours in a...
This is a cyclic scheduling problem unlike the other personnel scheduling problems we considered earlier which were acyclic. In this case, for example, a driver who starts his working week on Friday will work for the rest of the week (F, Sa and Su) and the first part of the following week (M and Tu) while is taking off W and Th (see attached file). In other words, his schedule spans not just one week (cycle) but two. The decision...
What are the 8 errors in this C++ program below: /* CSE 100 Professor Feng Learn to read data from user and fill a two-dimensional array. Learn how to compute the sum of one row or one column in a 2D array Learn how to compute the sum, average of a 2D array */ #include<iostream> #include<cmath> #include<iomanip> using namespace std; double bananaMon=0; //Global Variables to be used in the program double bananaSat=0; double totalSum=0.0; //Global variable total sum double findGroupTotal();...
IN PYTHON the original problem was Design (pseudocode) and implement (source code) a program (name it WeeklyHours) to compute the total weekly hours for 3 employees. The program main method defines a two-dimensional array of size 3x7 to store employers’ daily hours for the week. Each row represents one employee and each column represent one day of the week such that column 0 designates Monday, column 1 designates Tuesday, etc. The program main method populates the array with random numbers...
The XYZ Company needs you to write a program that will allow them to enter the weekly sales for a salesperson and then the program will calculate things such as most sales (and what day on which they happened), least sales (and day on which they happened), total sales, and daily average. The program will need to do the following: • Validate the user input to ensure that it is not less than 0.0 (0.0 will be acceptable if there...
Problem 7-5 Prepaid Insurance and the Monthly Prepaid Insurance Adjusting Entry On September 1, 2019, Amy's Floral Shop, Inc. paid cash for the following two insurance policies Insurance Policy #1 Auto and Truck Type of insurance coverage Starting date of the insurance coverage. September 1, 2019 Period of time coverage is for..3 months Total cost of coverage paid in advance... $525 Insurance Policy #2 Type of insurance coverage.. Business Liability Starting date of the insurance coverage .. Sseptember 1, 2019...