need check !

Write a program that keeps track the Lemonade sales for five weekdays: Monday,
Tuesday, Wednesday, Thursday, and Friday. It should use two parallel five-element
arrays: an array of strings that holds the five weekdays and an array of double that holds
the sales amount for each day. The weekday names should be stored using an
initialization list at the time the name array is created. The program should prompt the
user to enter the sales amount sold for each day. Once the sales data has been entered,
the program should produce a report that displays sales for each day and total sales for
five days.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
  #include <iostream>

using namespace std;

int main()
{
    string weekDays[]={"Monday","Tuesday","Wednesday","Thursday","Friday"};
    int sales[5];
    int temp,i,sum=0;
    cout<<"\nEnter the sales for a week.";
    for(i=0;i<5;i++)
    {
        do
        {
        cout<<"\nSales for "<<weekDays[i]<<" :";
        cin>>temp;
        if(temp<0)
        {
            cout<<"Invalid sales. Please Reenter:";
        }
        }while(temp<0);
        sales[i]=temp;
    }
    cout<<"\nSales for a week :";
    for(i=0;i<5;i++)
    {
        cout<<"\n"<<weekDays[i]<<" :"<<sales[i];
        sum=sum+sales[i];
    }
    cout<<"\nTotal Sales :"<<sum;
    return 0;
}


is it correct? when I ran they appeared a error message
What error message are you getting?

The problems calls for an array of double for sales, right now you've got an array of int.

It should use two parallel five-element
arrays: an array of strings that holds the five weekdays and an array of double that holds
the sales amount for each day.
Topic archived. No new replies allowed.