/*
Programmer: Jimboy B. Barbado
Subject: Strutured Programming using C++
Course: BIT 31
Schedule: 8:00 - 11:00 am
Instructor: Brian De Vivar
Program Description: character code
Activity # 1 for midterm
Title: Aling Nena's Store
*/
#include
void main() {
char code;
int tomatoes = 60;
int potatoes = 25;
int onions = 120;
int quantity = 0;
int total = 0;
int payment = 0;
float change;
cout << " ALING NENAS STORE\n\n\n"; cout << " PRODUCTS\n\n\n"; cout << "ITEM CODE ITEM NAME PRICE\n\n"; cout << " A Tomatoes 60/kilo\n"; cout << " B Potatoes 25/kilo\n"; cout << " C Onions 120/kilo\n\n\n"; cout << "Enter Item Code to Buy: "; cin >> code;
cout << "How many kilos?: "; cin >> quantity;
if ((code == 'A') || (code == 'a'))
total = tomatoes * quantity;
else if ((code == 'B') || (code == 'b'))
total = potatoes * quantity;
else if ((code == 'C') || (code == 'c'))
total = onions * quantity;
else
cout << "INVALID STATEMENT!\n"; cout << "The Total Amount You Buy is: " <<>> payment;
change = payment - total;
cout << "Your change is: " << change;
return;
}