Thursday, July 31, 2008

cout

#include
void main() {
char choices;
cout<<"Choose from the list:";
cout<<"(a)Chicken with rice:P42.00";
cout<<"(b)Porkasado with chowrice:P68.00";
cout<<"(c)Beefsteak,rice with coke:P120.00";
cout<<"what will be your order? (enter letter only):";
cin>>choices;
switch (choices) {
case 'a':
cout<<"Good Choice!";
break;
case 'b':
cout<<"Very nice!";
break;
case 'c':
cout<<"That's great!";
break;
default:
cout<< "Please enter correct code!";
}
cout<<"Thank you for ordering!";
return; }

Friday, July 25, 2008

Program sa C++ pakitandaan nmn

/*
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;

}

Thursday, July 3, 2008

PROGRAMMING

/*Programmer Alvin Broniola
Course/Sec: Bit-31
Subject: Structure Programming in C++
Schedule: 8:00-11:00am
Instructor: Brian D, De Vivar
*/
#include

int main()
{
cout <<"\t\tPersonal Info\n\n\n";
cout <<"\tName Alvin B. Broniola\n";
cout <<"\tAge 18\n";
cout <<"\tBirtday January 14 1990\n";
cout <<"\tGender Male\n";
cout <<"\tCivil Status Sigle\n";
cout <<"\tAddress Blk 4 lot 37 purok 1\n";
cout <<"\tUpper Bicutan Taguig City\n";
cout <<"\tContact No. 09082514886\n";
cout <<"\t\n\n\n\n\n\n\n\n\n";
return 0;
}