Him and thank you for the help in advance. I was just doing one of my assignments for school and I stumbled upon a problem. It's a simple bill calculator that differentiates you between a premium user and a regular one and calculates your bill based on the different rates. I thought I had finished it but now I'm getting this error. Please any help will do, just want to get this all said and done with.
Debug Error!
Program : ...\ConsoleApplication12.exe
Module : ...\ConsoleApplication12.exeRun-Time Check Failure #3 - T
#include <iostream>
#include<iomanip>
using namespace std;
int main() {
const float Regular = 10;
const float Premium = 25;
const float RRate = .2;
const float DRate = .1;
const float NRate = .05;
int account;
int Rminutes;
int Dminutes;
int Nminutes;
int totalmin;
float Dcharge;
float Ncharge;
float total;
char service;
cout << "Enter the account number\n";
cin >> account;
cout << "Enter the service code\n";
cin >> service;
switch(service)
{case'r':
case'R':
cout << "Please enter the total amount of minutes used\n";
cin >> Rminutes;
if (Rminutes > 50) {
total = (Rminutes - 50)*RRate + Regular;
}
else {
total = Regular;
}
break;
case'P':
case'p':
cout << "Please enter how many minutes were used during the day\n";
cin >> Dminutes;
cout << "Please enter how many minutes were used during the night\n";
cin >> Nminutes;
if (Dminutes > 75) {
Dcharge = (Dminutes - 75)*DRate;
}
if (Nminutes > 100) {
Ncharge = (Nminutes - 100)*NRate;
}
total = Premium + Dcharge + Ncharge;
break;
default:
cout << "Invalid service code\n";
return 1;
break;
}
totalmin = Rminutes + Dminutes + Nminutes;
cout << "Your account number is:" << account;
cout << "Your type of service is:" << service;
cout << "your total minutes used was" << totalmin;
cout << "your bill is" << total;
return 0;
}