I'm not understanding the error I'm getting.

#include <iostream>
using namespace std;

const double rServiceCost = 10.00;
const double rPerMinuteCharge = .20;
const double pServiceCost = 25.00;
const double pDayPerMinuteCharge = .10;
const double pNightPerMinuteCharge = .05;

int main()
{

int minutes;
int dayMinutes;
int nightMinutes;
double dayMinuteCharge;
double nightMinuteCharge;
char serviceCode;
int accountNumber;
double amountDue;
double totalPremiumCharge;

cout << "Enter an account number: ";
cin >> accountNumber;
cout << endl;

cout << "Enter a service code: R or r (regular), P or p (premium): ";
cin >> serviceCode;
cout << endl;

switch (serviceCode)
{
case 'r':
case 'R': cout << "Enter the number of minutes used: ";
          cin >> minutes;
          cout << endl;

          if (minutes <= 50)
              amountDue = rServiceCost;
          else
              amountDue = rServiceCost + ((minutes - 50) * rPerMinuteCharge);

          cout << "Account number: " << accountNumber << endl;
          cout << "Type of service: " << serviceCode << endl;
          cout << "Number of minutes used: " << minutes << endl;
          cout << "Amount Due = $" << amountDue << endl;
          break;

case 'p':
case 'P': cout << "Enter the number of day minutes used: ";
          cin >> dayMinutes;
          cout << endl;
          cout << "Enter the number of night minutes used: ";
          cin >> nightMinutes;
          cout << endl;
          if (dayMinutes > 75)
              dayMinuteCharge = (pDayPerMinuteCharge * (dayMinutes - 75));
          else
              dayMinuteCharge = 0
          if (nightMinute > 100)
              nightMinuteCharge = (pNightPerMinuteCharge * (nightMinutes - 100));
          else
              nightMinuteCharge = 0

          totalPremiumCharge = dayMinuteCharge + nightMinuteCharge + serviceCode;

          cout << "Account number: " << accountNumber << endl;
          cout << "Type of service: " << serviceCode << endl;
          cout << "Number of day minutes used: " << dayMinutes << endl;
          cout << "Number of night minutes used: " << nightMinutes << endl;
          cout << "Amount due = $" << totalPremiumCharge << endl;
          break;

          default: cout << "Invalid service code" << endl;

          }

cin >> accountNumber;
cin >> serviceCode;
cin >> minutes;
cin >> amountDue;
cout << endl;

          return 0;
}

Edited 3 Years Ago by Dani: Formatting fixed

nevermind i fixed the error...now it's just getting it to output to the screen so i can see if what I am doing is right

This article has been dead for over six months. Start a new discussion instead.