You are on page 1of 1

CC102 C++ Lab 1

#include <iostream>
using namespace std;

int main() {
string name,item1,item2;
float price1,price2,iTot1,iTot2,TotAmount;
float qty1,qty2;

cout << "Enter Customer Name:";


cin >> name;

cout <<"Enter item 1:";


cin>>item1;
cout<<"Enter qty:";
cin>>qty1;
cout<< "Enter price:";
cin>>price1;
iTot1 = qty1 * price1;

cout <<"Enter item 2:";


cin>>item2;
cout<<"Enter qty:";
cin>>qty2;
cout<< "Enter price:";
cin>>price2;
iTot2 = qty2 * price2;
TotAmount = iTot1 + iTot2;

cout<<"Sales"<<endl;
cout<<"Customer Name: "<< name<<endl;
cout<<"Item Purchased:"<<endl;
cout<<item1 << " - " << qty1 <<" pcs x " << price1 <<"pesos - item
total: " << iTot1 <<endl;
cout<<item2 << " - " << qty2 <<" pcs x " << price2 <<"pesos - item
total: " << iTot2 <<endl;
cout<<"Total Amount: " << TotAmount;
return 0;

You might also like