#include <conio.h> #include <iostream.h> #include <iomanip.h> int minutesused, rental, prepaidminutes, paidmins, minscost, totalcost, totalmins; char tariff[1]; void main(){ cout<<"Enter the Tariff: "; cin>>tariff; cout<<"Enter Minutes call time used this month: \n"; cin>>minutesused; if (tariff == "A" || tariff == "a") rental = 0; prepaidminutes = 0; if (tariff == "B" || tariff == "b") rental = 4.00; prepaidminutes = 50; if (tariff == "C" || tariff == "c") rental = 7.25; prepaidminutes = 100; if (tariff == "D" || tariff == "d") rental = 12.75; prepaidminutes = 200; if (tariff == "E" || tariff == "e") rental = 20.00; prepaidminutes = 400; if (minutesused > prepaidminutes) paidmins = minutesused - prepaidminutes; if (paidmins <= 10) minscost = paidmins * 0.10; else if (paidmins <= 30) minscost = 3.00 + (paidmins - 10) * 0.2; else minscost = 7.00 + (paidmins - 30) * 0.1; totalcost = rental + minscost; cout<<setw(15)<<"Call Cost "<<char(156)<<minscost<<"\n"; cout<<setw(15)<<"Rental "<<char(156)<<rental<<"\n"; cout<<setw(15)<<"Total Cost "<<char(156)<<totalcost<<"\n"; getch(); }It is a mobile phone tariff.
it asks for the tarif and the minutes u have used then gives out the final monthly cost includin the minutes that where free.
the only thing is that i cant seem to get it to work
it asks for everythin but doesnt do any working out and the final stage finishes with no prices.
btw im using Borland C++