Professional Documents
Culture Documents
Adding Text Color in C
Adding Text Color in C
Example:
1. Make a program that will asks the employees number of hours worked and rate per hour and display
his salary.
#include <iostream>
using namespace std;
int main()
{
system("COLOR 0a");
int intHour, intRate, intSalary;
cout<<"Hours worked:"<<endl;
cin>>intHour;
system("CLS");
cout<<"Rate per hour:"<<endl;
cin>>intRate;
system("CLS");
intSalary=intHour * intRate;
cout<<"Salary:"<<intSalary<<endl;
system("pause");
return 0;
}
2. Make a program that will ask the original price of the shirt, display the 25% discount, and the new
price.
#include <iostream>
using namespace std;
int main()
{
system("COLOR 0a");
float fltPrice, fltDiscount, fltNewprice;
cout<<"Original price:"<<endl;
cin>>fltPrice;
fltDiscount=fltPrice *.25;
cout<<"Discount:"<<fltDiscount<<endl;
fltNewprice=fltPrice-fltDiscount;
cout<<"New price:"<<fltNewprice<<endl;
system("pause");
return 0;
}Activity:
1. Develop a program that will ask the number of kilometers travelled, the fare per kilometer and display
the total fare.
2. Make a program that will ask the charge per minute of phone call, the number of minutes used ,the
subtotal, the tax @5%, and the total bill.
3. Write a program that will ask the price per shirt, the number of shirt ordered, and display the total
cost.
Pseudocode
-“Pseudo” means imitation or false and “code” refers to the instructions written in a programming
language.
-a notation resembling resembling a simplified language.
-also called Program Design Language.
Nesting tags
-To nest tags, use the first in-last out rule.