Ok ill try in a minute
my whole code is currently
Quote:
#include <conio.h>
#include <iostream.h>
main()
{
int numberQuotes,error;
char nextDay;
float weight,cost,deliveryCharge,total;
char pound=156; //used to display pound sign
string weight;
cout<<"\n\t WELCOME TO SOLUTIONSRUS PARCEL DELIEVERY CALCULATOR.";
cout<<"\n\n\t\t PRESS ANY KEY TO START";
getch();
clrscr();
do{
cout<<"\n How many quotes do you wish to calculate?";
cin>>numberQuotes;
if(numberQuotes<0)
{
cout<<"\n Error! Please enter a positive number only\n";
}
}while (numberQuotes<0);
clrscr();
do{
clrscr()
do{
cout<<"\n Enter the weight of the package to be delivered ";
cin>>weight;
if(weight<0)
{
cout<<"\n Error! ENTER A POSITIVE NUMBER ONLY";
}
if(weight<=1)
{
cost=2.50;
}
if (weight >1 && weight <=10)
{
cost=7.50;
}
if (weight>=10)
{
cost=10.00;
}
} while(weight<0);
do{
cout<<"\n Do you require next day delievey? (Enter Y or N)";
cin>>nextDay;
if (nextDay=='Y' || nextDay=='y')
{
error=0;
deliveryCharge=cost/100*10 ;
total=deliveryCharge+cost ;
cout<<"\n Total charge inc next day delievery is " <<pound <<total;
cout<<"\n PRESS ANY KEY TO CONTINUE";
getch();
}
else if (nextDay=='N' || nextDay=='n')
{
error=0;
cout<<"\n Total Charge for standard delievery is " <<pound <<cost;
cout<<"\n PRESS ANY KEY TO CONTINUE";
getch();
}
else
{
error=1;
cout<<"Error! You have entered an invalid charater, please use Y/N";
}
}while(error==1);
numberQuotes--;
}while(numberQuotes>0);
cout<<"\n\n PRESS ANY KEY TO EXIT";
getch();
}