w

ccc
Last edited on
closed account (o3hC5Di1)
Hi there,

How about you share your code with us (don't forget to wrap it in [code][/code] tags), and we'll take it from there? :)

All the best,
NwN
closed account (o3hC5Di1)
Hi there,

Looking at your billing() funciton (that's the one causing trouble right?):

120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
void billing(user obj)
            {
                 float rate_per_hr,total_cost;
                  cout<<"\n\n--------------------------------------------------------------------------------------------------";
                  cout<<"\n\nBILLING\n========";
                 if(obj.choice==1)
                 {
                                  rate_per_hr=92.25;
                                  cout<<"\nRate per hour for Porche 911 turbo is:"<<rate_per_hr;
                 }
                 else if(obj.choice==2)
                 {
                                  rate_per_hr=85.25;
                                  cout<<"\nRate per hour for Maruti Omni is:"<<rate_per_hr;
                 }
                 else if(obj.choice==3)
                 {
                                  rate_per_hr=105.75;
                                  cout<<"\nRate per hour for Tata Safari is:"<<rate_per_hr;
                 }
                 else if(obj.choice==4)
                 {
                                  rate_per_hr=117.55;
                                  cout<<"\nRate per hour for Tavera is:"<<rate_per_hr;
                 }
                 else
                 {
                                  rate_per_hr=97.50;
                                  cout<<"\nRate per hour for Tata Indigo is:"<<rate_per_hr;
                 }
                 cout<<"\n\nThe amount to be paid by the user is:";
                 total_cost=rate_per_hr*(obj.no_of_hrs);
                 cout<<total_cost<<endl<<endl;
                 system("pause");
                 cout<<"\n\nTHANK YOU";
                     system ("color C9");
 
               
//Why do you clear the screen here, after you've outputted the invoice?
system("cls");

//Why would you put this here?
using namespace std;

cout << "\t\t\t\t" << "Your invoice..." << endl; 

system ("PAUSE");

            }


I think you could remove that whole bolded area from the function and it might just work - unless this is a copy/paste glitch you made?

All the best,
NwN
Topic archived. No new replies allowed.