Question
Pseudocode please
Special Problem for Swap 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 array, where each row represents a different monkey and each column represents a different day of the week. The monkeys are represented by integers 1, 2, and 3; the weekdays are Sunday Monday Tuesday. Wednesday. Thursday. Friday. Saturday. The program should first prompt the user to input the data for each monkey, starting with Sunday for monkey #1, then monkeys #2 and #3. followed by Monday for monkey #1, then monkeys #2 and #3 and so on, through-Saturday. The program then creates a report that includes the following information, each properly labeled (see below) Average anount 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 nput Validation: Do not accept negative numbers for pounds of food eaten. When a negative value is entered, the program outputs invalid negative) food quantity re-enter and attempts to reread the value Prompts And Output Labels: Each item read should be prompted for by a string of the form Enter the food eaten by nonkey N on DAY or Saturday where N is 1 or 2 or 3, and DAY is Sunday or Monday or The output should be of the form: Average food consumed daily by this group of monkeys: 6.23 The least daily food consumed was by Monkey #1 on Friday The most daily food consumed was by Monkey #3 on Sunday where the specific amount of food or specific monkeys or specific days identified depend on the actual input
0 0
Add a comment Improve this question Transcribed image text
Answer #1

#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!

Add a comment
Know the answer?
Add Answer to:
Pseudocode please Special Problem for Swap A local zoo wants to keep track of how many...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • C++ Monkey Business A local zoo wants to keep track of how many pounds of food...

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

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

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

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

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

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

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

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

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT