The Student Room Group

Pseudocode-Please help!!

27F68EDF-CCF0-46A7-9D37-B0BF20A2E229.jpeg5C9E13A0-A32C-4013-BFE5-AC3CD1660BAC.jpeg
ive lost quite a few marks on these questions- does anyone know what to do next??
thanks!
Reply 1
Original post by puppy_punk
27F68EDF-CCF0-46A7-9D37-B0BF20A2E229.jpeg5C9E13A0-A32C-4013-BFE5-AC3CD1660BAC.jpeg
ive lost quite a few marks on these questions- does anyone know what to do next??
thanks!

(

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();
(edited 6 months ago)

Quick Reply

Latest

Trending

Trending