#include "stdafx.h" #include <iostream> using namespace std; int _tmain() { char input = '0'; while(input != 'd' && input != 'g') { cout << "Please select a company to recieve a quote from\nDHL - (d)\nGlobalMail - (g)\n\n(select either g or d)->"; cin >> input; } cout << "\n\n"; switch (input) { case 'd': break; case 'g': cout << "GlobalMail, great choice! Please enter the weight of your parcel\n->"; int weight = NULL; cin >> weight; weight = calcPostage(weight); //this line breaks cout << "Your package will cost R" << weight; break; } return 0; } int calcPostage(int weight) { return weight * 108; } int calcPostage(int length, int width, int height) { return (length * width * height) / 5000; }</iostream>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)