The Student Room Group

Help Computer science

Sara is writing a program to input her monthly phone bills and output the month name and amount for each month along with the month that had the maximum cost.
She has defined an array to hold the month names.
Complete the pseudocode program. [6]
// Program to output maximum month’s phone bill
array monthName = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"]
// Define an array to hold the phone bills for each month
(edited 6 months ago)
Reply 1
Is there any more information? Photo of the question would be better
Reply 2
Original post by eviet0130
Sara is writing a program to input her monthly phone bills and output the month name and amount for each month along with the month that had the maximum cost.
She has defined an array to hold the month names.
Complete the pseudocode program. [6]
// Program to output maximum month’s phone bill
array monthName = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"]
// Define an array to hold the phone bills for each month


int billamount[12];

char monthname["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];

for (int month = 1; month<=12; month++)
{
cout<<"Enter the amount of bill for the month"<<month; cin>>billamount[month];

}

for (i=0; i<= 12; i++)
{
if (billamount[0]<billamount)

billamount[0]=billamount;

monthname[0]=monthname;

}

cout<<"Maximum months phone bill"<<monthname[0] <<"="<<billamount[0]

getch();

*Note this is written in programming language and not pseudocode but it's easy to turn this into pseudocode.
Reply 3
Is this an a level or a GCSE question? What year are you in?

Quick Reply

Latest

Trending

Trending