Im trying to do this project for class and i can seem to find where my problem is, i am still pretty new at this here is my code
Code:
#include <iostream>
#include <fstream>
#include <cctype>
using namespace std;
int main()
{
int r,p;
int plan,account,amount;
float min,dmin,nmin,amount1,amount2;
ofstream outfile;
outfile.open("out.txt");
r=0;
p=1;
cout<< "Which Service? (r) for Regular or (p) for Premium.\n";
cin>> plan;
(plan==r);
{
cout<< "Please enter total minutes used: "<<endl;
cin>> min;
(min<=100);
cout<< "Please enter Account Number: \n";
cin>> account;
cout<< "Account Number: "<<account<<endl;
cout<< "Type of Service: Regular"<<endl;
cout<< "Minutes Used: "<<min<<endl;
cout<< "Bill Amount: $10.00"<<endl;
outfile<< "Account Number: "<<account<<endl;
outfile<< "Type of Service: Regular"<<endl;
outfile<< "Minutes Used: "<<min<<endl;
outfile<< "Bill Amount: $10.00"<<endl;
}
{
(min>100);
cin>>min;
cout<< "Please enter Account Number: \n";
cin>> account;
cout<< min-100*(.05)+(10);
cin>> amount;
cout<< "Account Number: "<<account<<endl;
cout<< "Type of Service: Regular"<<endl;
cout<< "Minutes Used: "<<min<<endl;
cout<< "Bill Amount: $"<<amount<<endl;
outfile<< "Account Number: "<<account<<endl;
outfile<< "Type of Service: Regular"<<endl;
outfile<< "Minutes Used: "<<min<<endl;
outfile<< "Bill Amount: $"<<amount<<endl;
}
(plan==p);
{cout<< "Please Enter Account Number:\n";
cin>> account;
cout<< "Please Enter Total Day Time Minutes:\n";
cin>> dmin;
if (dmin<=175)
{ cin>>dmin;
cout<< "Please Enter Total Number of Night Time Minutes:\n";
cin>> nmin;
}else {
(dmin>175);
cin>>dmin;
cout<<dmin - 175*(.035);
cin>>amount1;
}
if (nmin<=100)
{ cin>>nmin;
cout<< "Account Number: "<<account<<endl;
cout<< "Type of Service: Premium"<<endl;
cout<< "Minutes Used: "<<dmin+nmin<<endl;
cout<< "Day Minutes: "<<dmin<<endl;
cout<< "Night Minutes: "<<nmin<<endl;
cout<< "Bill Amount: $20.00"<<endl;
outfile<< "Account Number: "<<account<<endl;
outfile<< "Type of Service: Premium"<<endl;
outfile<< "Minutes Used: "<<dmin+nmin<<endl;
outfile<< "Day Minutes: "<<dmin<<endl;
outfile<< "Night Minutes: "<<nmin<<endl;
outfile<< "Bill Amount: $20.00"<<endl;
}else {
(nmin>100);
cin>>nmin;
cout<<nmin - 100*(.02);
cin>>amount2;
cout<< "Account Number: "<<account<<endl;
cout<< "Type of Service: Premium"<<endl;
cout<< "Minutes Used: "<<dmin+nmin<<endl;
cout<< "Day Minutes: "<<dmin<<endl;
cout<< "Night Minutes: "<<nmin<<endl;
cout<< "Bill Amount: $"<<amount1+amount2+20<<endl;
outfile<< "Account Number: "<<account<<endl;
outfile<< "Type of Service: Premium"<<endl;
outfile<< "Minutes Used: "<<dmin+nmin<<endl;
outfile<< "Day Minutes: "<<dmin<<endl;
outfile<< "Night Minutes: "<<nmin<<endl;
outfile<< "Bill Amount: $"<<amount1+amount2+20<<endl;
}
}
outfile.close();
return 0;
}
and the output is like this and i need it to be like i'm trying to do in the code
[output]
Account Number: -858993460
Type of Service: Regular
Minutes Used: -1.07374e+008
Bill Amount: $10.00
Account Number: -858993460
Type of Service: Regular
Minutes Used: -1.07374e+008
Bill Amount: $-858993460
Account Number: -858993460
Type of Service: Premium
Minutes Used: -2.14748e+008
Day Minutes: -1.07374e+008
Night Minutes: -1.07374e+008
Bill Amount: $20.00
[/output]