I am trying and I don't know what to do. Attached is a aprogram and I don't know what is going wrong. :sad:
ANRCCC 0 Newbie Poster
//Amanda Richardson
//Cell Phone Bill
//Due 2-18-05
#include <iostream>
#include <iomanip>
using namespace std;
int main()
{
char plan;
int weekday, weekend, text, overage_a, over_a, over_b, over_texta;
double over_day, over_enda, over_endb, over_texa, over_texb, total, grand_total;
const double TAX=.03, BASE_PRICEA=39.95, BASE_PRICEB=19.95
cout << "Plan 'A' or 'B': " << endl;
cin >> plan;
if (plan == 'A')
BASE_PRICEA;
else
BASE_PRICEB;
cout << "Enter the number of weekday minutes used: ";
cin >> weekday;
overage_a = 250 - weekday;
over_day = overage_a * -0.25
minutes_day = weekday * 0.30
if (plan == 'B')
cout << "Your Weekday minutes will cost: $" << minutes_day << endl;
else if (plan == 'A' && weekday > 250)
cout << "Went over weekday minutes by:" << overage_a << "minutes" << endl;
cout << "This will cost and extra: $" << over_day << endl;
else (plan == 'A' && weekday < 250)
cout << "No weekday overages" << endl;
cout << "Enter the number of weeken minutes used:";
cin >> weekend;
over_a = 1000 - weekend;
over_b = 200 - weekend;
over_enda = over_a * -0.15;
over_endb = over_b * -0.30;
if (plan == 'B'&& weekend <= 200)
{
cout << "You did not go over yor weekend minutes" << endl;
}
else (plan == 'B' && weekend > 200)
{
cout << "You went over your weekend minutes by: " << over_b << "minutes" << endl;
cout << "This will cost you $" << over_endb << endl;
}
if (plan == 'A' && weekend <= 1000)
{
cout << "You did not go over your weekend minutes" << endl;
}
else (plan == 'A' && weekend > 1000)
{
cout << "You went over your weekend minutes by: " ,, over_a << "minutes" << endl;
cout << "This will cost you $ " << over_enda << endl;
}
cout << "Enter the number of text messages used:";
cin << text;
over_texta = 250 - text;
over_texa = over_texta * -0.10;
over_texb = text * 0.15;
if (plan == 'B')
cout << "Your text messasges cost: $" << over_texb << endl;
else if (plan == 'A' && text <= 250)
cout << "You did not go over your text minutes" << endl;
else (plan == 'A' && text > 250)
cout << "You went over your text messages by: " << over_texta << endl;
cout << "This will cost you: $" << over_texb << endl;
total = (BASE_PRICEA || BASE_PRICEB) + (overage_day || minutes_day) + (over_enda || over_endb) + (over_texa || over_texb);
tax = total * TAX
grand_total = total + tax
cout << "Total: $" << total << endl;
cout << "Tax: $" << tax << endl;
cout << "Your Grand Total: $" << grand_total << endl;
system("pause");
return 0;
}
Narue 5,707 Bad Cop Team Colleague
How do you know it's not doing something right? I'm not going to download an attached file with such an uninteresting name just to hunt down a mystery "it doesn't work" error. Be VERY specific about what your program should do, what you think it's doing, and what it's actually doing.
ANRCCC 0 Newbie Poster
My program is suppose to tell you the cost of your phone bill. We are just learning if/else statements. Every time a I put a number in, it will cout both the if and the else statement and becaue of this, I get the wrong total for the bill.
Narue 5,707 Bad Cop Team Colleague
I'm still not going to download an attached file. But since, you double posted this, someone else was kind enough to answer your question in the other thread.
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.