ALI INAM -8 Newbie Poster

well i compiled it before and after you told me and it worked perfectly
i know that there are some glitches in it but minor ones that does not
invoke compilation errors and you are not missing any thing i am a mear 16 year old boy who started programming 2 weeks earlier

ALI INAM -8 Newbie Poster
#include <iostream>
double a = 0;
double b = 0;
double c = 0;
double d = 0;
double add = 0;
double sub = 0;
double mul = 0;
double f = 0;
int main () {
	std::cout << "Enter any one of the following " << std::endl;
	std::cout << "1 for ADDITION " << std::endl;
	std::cout << "2 for SUBTRACTOIN " << std::endl;
	std::cout << "3 for MULTIPLICATOIN " << std::endl;
	std::cout << "4 for DIVISION " << std::endl;
	std::cin >> a;
	std::cout << ' ' << std::endl;
	std::cout << "Enter first number: " <<std::endl;
	std::cin >> b;
	std::cout<< ' ' << std::endl;
	std::cout << "Enter second number: " << std::endl;
	std::cin >> c;
	std::cout<< ' ' << std::endl;
	if ( a == 1) {
		add = b + c;
		std::cout << add <<  std::endl;
	}else if ( a == 2){
		sub = b - c;
		std::cout << sub <<  std::endl;
	}else if (a == 3) {
		mul = b * c;
		std::cout << mul <<  std::endl;
    }else if (a == 4){
		f = b / c;
		std::cout << f <<  std::endl;

	}
	


}

well here is simple solution to your very simple project

ALI INAM -8 Newbie Poster
#include "stdafx.h"
#include <iostream>
#include <fstream>
#include <string>
double a = 0;
double b = 0;
double c = 0;
char t = '\t';
int i = 0;
double total = 0;
using namespace  std;
do {
	++i;
int main () {
	string line1, line2 , line3;
	std::cout << "First Item: " << std::endl;
    getline(cin, line1);
	std::cout << "Second Item: " << std::endl;
	getline(cin, line2);
	std::cout << "Third Item: " << std::endl;
	getline(cin, line3);
	std::cout << ' ' << std::endl;
	std::cout << "Enter Price for first item " << std::endl;
	std::cin >> a;
	std::cout << "Enter Price for second item " << std::endl;
	std::cin >> b;
	std::cout << "Enter price for third item " << std::endl;
	std::cin >> c;
	
	std::cout << ' ' << std::endl;
	std::cout << ' ' << std::endl;
	std::cout << "ITEM PRICE " << std::endl;
	std::cout << ' ' << std::endl;
	std::cout << "--------------------------------------------------" << std::endl;
	std::cout << line1 << t << a << std::endl;
	std::cout << ' ' << std::endl;
	std::cout << line2 << t << b << std::endl;
	std::cout << ' ' << std::endl;
	std::cout << line3 << t << c << std::endl;
	std::cout << ' ' << std::endl;
	std::cout << ' ' << std::endl;
	std::cout << ' ' << std::endl;
	total = a + b + c;
	std::cout << "------------------------------------------------" <<std::endl;
	std::cout << "TOTAL" << t << total << std::endl;
	cin.get();
	
  }while (i < 5);
}

i hope this helps you more then it helps me and all of you are mo9st welcome …

Nick Evan commented: No free cookies here. -4
tux4life commented: Remember: don't give free code! -3
JoBe commented: Trying to solve someone else his homework is not what should be done ! -1