1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Airida [17]
3 years ago
10

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 the following information: • Average amount 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.
Engineering
1 answer:
Kryger [21]3 years ago
6 0

Answer:

#include<iostream>

using namespace std;

int main()

{

  double data[3][5],avg,least,most,total;

  int leastNum,mostNum;

  for(int i=0;i<3;i++)

  {

      cout<<"Enter quantity of food for monkey "<<i+1<<":\n";

      for(int j=0;j<5;j++)

      {

          cout<<"Day "<<j+1<<": ";

          cin>>data[i][j];

      }

  }

  least = data[0][0];

  most = data[0][0];

  for(int i = 0;i<3;i++)

  {

      for(int j = 0;j<5;j++)

      {

          total+=data[i][j];

          if(data[i][j]>most)

          {

              most=data[i][j];

              mostNum=i+1;    

          }

          if(data[i][j]<least)

          {

              least=data[i][j];

              leastNum=i+1;

             

          }

      }

  }

  avg=total/5.0;

  cout<<"Average food eaten in a day by all the 3 monkeys: "<<avg<<endl;

  cout<<"Most amount of food eaten in a day: "<<most<<" by monkey: "<<mostNum<<endl;

  cout<<"Least amount of food eaten in a day: "<<least<<" by monkey: "<<leastNum<<endl;

  return 0;

}

You might be interested in
Carbon dioxide steadily flows into a constant pressure heater at 300 K and 100 kPa witha mass flow rate of 9.2 kg/s. Heat transf
docker41 [41]

Answer:

Carbon dioxide temperature at exit is 317.69 K

Carbon dioxide flow rate at heater exit is 20.25 m³/s

Explanation:

Detailed steps are attached below.

8 0
3 years ago
Problem 2
mamaluj [8]

Answer:

susmtqjqmjttqmjtqmjtmqutq

Explanation:

bakaf

fjgjgi5j6leny4mjtqjmu5tjmmwtjmjtj

8 0
3 years ago
Your Java program will be reading input from a file name strInput.txt. Each record contains String firstname String lastName Str
stiks02 [169]

Answer:

The program requires that you have the specified input files and it reads from each file at a time and processes salary in digits, states the city, state and bonus with respective first and last name as requested in the question. Note that you must have access to the mentioned output files for the program to work properly. Below is the java version of the program.

import java.io.File;

import java.io.FileNotFoundException;

import java.io.PrintWriter;

import java.util.Scanner;

class Driver

{

public static void main(String[] args) throws FileNotFoundException

{

Scanner sc = new Scanner(new File("strInput.txt"));

PrintWriter pd = new PrintWriter(new File("strOutputD"));

PrintWriter prf = new PrintWriter(new File("strOutputRF"));

String firstname = "", lastname = "", strSalary = "", status = "", cityState = "", city = "", state = "";

double salary = 0, bonus = 0;

int incorrectRecords = 0;

int dRecords = 0;

int fRecords = 0;

while(sc.hasNextLine())

{

firstname = sc.next();

lastname = sc.next();

strSalary = sc.next();

status = sc.next();

cityState = sc.next();

if(!status.equals("D") && !status.equals("F"))

{

System.out.println("Records is neither D nor F. Skipping this...");

incorrectRecords++;

continue;

}

else if(status.equals("D") || status.equals("F"))

{

char c = ' ';

int i = 0;

for(i=0; i<strSalary.length() && c != '.'; i++)

{

c = strSalary.charAt(i);

if(!Character.isDigit(c))

{

System.out.println("Char at position " + (i+1) + " in salary is not a digit");

incorrectRecords++;

continue;

}

}

if(c == '.')

{

if(i+1 == strSalary.length()-1)

{

if(!Character.isDigit(strSalary.charAt(i)))

{

System.out.println("Char at position " + (i+1) + " in salary is not a digit");

incorrectRecords++;

continue;

}

if(!Character.isDigit(strSalary.charAt(i+1)))

{

System.out.println("Char at position " + (i+1+1) + " in salary is not a digit");

incorrectRecords++;

continue;

}

}

else

{

System.out.println("Period is in the wrong position. Expected at " + (strSalary.length()-3) + " but found at " + (i+1));

continue;

}

}

city = cityState.split(",")[0];

state = cityState.split(",")[1];

salary = Double.parseDouble(strSalary);

if(status.equals("D"))

{

bonus = salary * 0.125;

dRecords++;

pd.write(firstname + " " + lastname + " " + status + " " + salary + " " + bonus + " " + city + " " + state);

}

else

{

bonus = salary * 0.18;

fRecords++;

prf.write(firstname + " " + lastname + " " + status + " " + salary + " " + bonus + " " + city + " " + state);

}

}

}

System.out.println("No of D records : " + dRecords);

System.out.println("No of F records : " + fRecords);

System.out.println("No of incorrect records : " + incorrectRecords);

}

}

6 0
3 years ago
Which claim does president Kennedy make in speech university rice ?
mafiozo [28]

Answer:  The United States must lead the space race to prevent future wars.

Explanation: Hope this helps

4 0
2 years ago
Read 2 more answers
The drag force, Fd, imposed by the surrounding air on a
Ad libitum [116K]

Answer:

a)  23.551 hp

b)  516.89 hp

Explanation:

<u>given:</u>

F_{d} =\frac{1}{2} C_{d} A_{p} V^{2} \\V_{a}=25 m/hr-->25*\frac{5280}{3600} =36.67ft/s\\V_{b}=70 m/hr-->70*\frac{5280}{3600} =102.67ft/s\\\\C_{d}=.28\\A=25 ft^2\\p=.075lb/ft^2

<u>required:</u>

the power in hp

<u>solution:</u>

(F_{d})_{a}  =\frac{1}{2} C_{d} A_{p} V_{a} ^{2}.............(1)

by substituting in the equation (1)

         =353.27 lbf

(F_{d})_{b}  =\frac{1}{2} C_{d} A_{p} V_{b} ^{2}..........(2)

by substituting in the equation (2)

         = 2769.29 lbf

power is defined by

             P=F.V

     P_{a}=353.27*36.67

           =12954.411 lbf.ft/s

           =12954.411*.001818

           =23.551 hp

      P_{a}=2769.29*102.67

           = 284323 lbf.ft/s

           = 284323*.001818

           = 516.89 hp

3 0
3 years ago
Other questions:
  • What Degree Do You Need To Become a Solar Engineer?<br> (2 or more sentences please)
    13·1 answer
  • Find the sum and product of each of these pairs of numbers. Express your answers as a base 3 expansion. Hint: We can just add an
    5·1 answer
  • What is the major drawback to use whiskers as a dispersed agents in composites? a)- High price b)- Large length to diameter rati
    7·1 answer
  • List two common units of measurement to describe height
    5·2 answers
  • The ultimate BOD of a river just below a sewage outfall is 50.0 mg/L, and the oxygen deficit at the outfall D0 is 2.0 mg/L. The
    6·1 answer
  • Choose the three questions that an engineer should ask himself or herself when identifying the need of a problem.
    6·2 answers
  • Who was the American founder and leader of the Shakers in the 1770’s who advocated equality, individual responsibility, and peac
    11·2 answers
  • What is the relationship between compressor work and COPR?
    14·1 answer
  • If the 2007 recession affected the green building materials market less seriously than other parts of the construction market, t
    12·2 answers
  • What can be used to measure the alcohol content in gasoline? A. Graduated cylinder B. Electronic tester C. Scan tool D. Either a
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!