Page 122 - Modular_V2.0_C++_Flikpbook
P. 122
}
else if(age >= 45 && age <= 55)
{
HRA = bsalary * 7/100;
DA = bsalary * 12/100;
GrossSalary = bsalary + DA + HRA;
}
else
{
cout<<"Invalid details.\n";
}
Project 4 21 st Century #Critical Thinking
Skills
Write the following C++ code and see the output:
#include<iostream.h>
#include<conio.h>
#include<stdlib.h>
void main()
{
clrscr();
int number = 0;
float cost = 0;
char ch;
int choice = 0;
do
{
cout<< "===== Welcome to ABC Drink Shop! =====" << endl;
cout<< "We offer the following drinks:" << endl;
cout<< "1: Coffee Rs. 50/-" << endl;
cout<< "2: Apple Juice Rs. 90/-" << endl;
cout<< "3: Soda Rs. 60/-" << endl;
cout<< "4: Tea Rs. 30/-" << endl;
cout<< "5: For Exit" << endl;
cout<< "What drink would you like?" << endl;
label:
cout<< "Enter your choice: ";
cin>> choice;
switch (choice)
{
120
Touchpad MODULAR (Ver. 2.0)

