hi everyone im new to this programming,
just wondered, i have this code and does anyone know how i can modify it so it will validate a postcode.
Code:
#include <iostream>
// need cmath if using ceil() library function
#include <cmath>
using namespace std;
const char POUND = 156; // value to output a pound sign, e.g.
// cout << POUND << "9" << endl;
// would output: £9.
// An alternative to this is to use the backslash sequence \234, e.g.
// cout << "\2347" << endl;
// would output: £7
// function prototypes as given in the assignment script
bool isValidPostcode(char postcode[]);
float calculateCost( int numberOfBottles);
float calculateVAT( float cost);
float calculateDeliveryCharge(int numberOfBottles);
void displayOrder(char initials[], char surname[ ], char address[],
char postcode[], int numberOfBottles, float cost,
float costPlusVAT, float deliveryCharge,
float totalCost );
bool enterAnotherOrder();
void main()
{
// main program loop
do
{
// validation loop for post code
do
{
} while(!isValidPostcode(postcode))
calculateCost(numberOfBottles);
calculateVAT(cost);
calculateDeliveryCharge(numberOfBottles);
displayOrder(initials, surname, address, postcode, numberOfBottles, cost,
costPlusVAT, deliveryCharge, totalCost);
} while(enterAnotherOrder());
}
system("pause");
}
Thanks for your help