answersLogoWhite

0

#include

using std::cout;

using std::endl;

double maxTemp(double temp, const int numberOfMonths);

int main()

{

const int numberOfMonths = 12;

double temp[numberOfMonths] = {0.0};

cout << endl << "Enter temperature for " << numberOfMonthes << " months";

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

{

cout << endl << i << " month:";

cin >> temp[i];

}

cout << endl << "Maximum temperature for the year is: " << maxTemp(temp, numberOfMonthes);

system("PAUSE");

return 0;

}

double maxTemp(double temp, const intnumberOfMonths)

{

double max = temp[0];

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

{

if ( max < temp[j])

{

max = temp[j];

}

}

return max;

}

User Avatar

Wiki User

15y ago

What else can I help you with?

Related Questions

How do you calculate the mean monthly temperature?

To calculate the mean monthly temperature, first, gather daily temperature readings for the entire month. Then, sum all the daily temperatures and divide that total by the number of days in the month. This will give you the average temperature for that month. Ensure to account for any missing data by either excluding those days or using an appropriate estimation method.


Maximum Mortgage?

Maximum Mortgage What is your maximum mortgage? That largely depends on your income and current monthly debt payments. This calculator collects these important variables and determines your maximum monthly housing payment and the resulting mortgage amount.


How can you calculate the days of monthly circulation?

To calculate the days of monthly circulation, multiply the average number of copies circulated per day by the number of days in the month. This will give you the total monthly circulation.


How can I calculate the monthly interest rate from an annual interest rate?

To calculate the monthly interest rate from an annual interest rate, divide the annual rate by 12. This will give you the monthly interest rate.


How can I calculate the monthly interest rate on a loan or investment?

To calculate the monthly interest rate on a loan or investment, divide the annual interest rate by 12. This will give you the monthly interest rate that is applied to the loan or investment.


How can I calculate the monthly percentage rate for a loan or investment?

To calculate the monthly percentage rate for a loan or investment, you can use the formula: Monthly Percentage Rate (Annual Percentage Rate / 12). This formula divides the annual rate by 12 to determine the monthly rate.


What is the highest monthly average temperature recorded in the region?

The highest monthly average temperature recorded in the region is 98 degrees Fahrenheit.


How do you calculate monthly hotel occupancy percentages?

120


Monthly average temperature of Sahara desert each month?

Monthly NormalsJanuaryFebruaryMarchAprilMayJuneJulyAugustSeptemberOctoberNovemberDecemberHigh Temperature ( C ) 222529333844454440342722 Low Temperature ( C ) 7101317222829292620138 Precipitation ( mm ) 3.73.51.21.60.50.10.00.50.21.20.52.7it at least gets down to 20 degrees or lower


What is the maximum cpp monthly pension?

The maximum CPP monthly pension for someone who starts receiving it at age 65 in 2021 is $1,203.75. This amount is adjusted each year based on increases in the cost of living.


How can I calculate the monthly payment with APR?

To calculate the monthly payment with APR, you can use the formula for loan payments: Monthly Payment P r(1r)n / (1r)n - 1 Where: P Principal loan amount r Monthly interest rate (APR divided by 12) n Number of monthly payments Plug in these values into the formula to find the monthly payment amount.


How is mortgage calculated?

A mortgage is calculate by multiplying the principle(or amount borrowed to purchase house), times the interest of the loan over the period of the loan. &lt;a href="http://www.acalculator.com/fha-mortgage-loan-calculator.html"&gt;Mortgage Calculator&lt;/a&gt; helps to find the maximum monthly payment and the maximum loan amount for which you may qualify, calculate your taxes/insurance and also to see if your income is sufficient to qualify.