Professional Documents
Culture Documents
EXPERIMENT NO 1
Objective:
LAB ASSESSMENT:
Data presentation
Experimental results
Conclusion
Date: Signature:
BCE-IA Introduction to Programming
Lab Report: 2
Introduction to Programming
Submitted By,
Junaid Waqas
210781
Submitted To:
Engr. Mariam Sabir
2
BCE-IA Introduction to Programming
LAB TASK:
Write a Program using DEVC++ (Software) and also understand the basic
Operations.
Write header files at the top of Program.
Write the program by using extraction operators with terminators at the Last
while keeping in view the other symbol.
Write a Program to check whether a triangle is Valid or not.
CODE:
OUTPUT:
4
BCE-IA Introduction to Programming
LAB TASK:
Write a Program using DEVC++ (Software) and also understand the basic
Operations.
Write header files at the top of Program.
Write the program by using extraction operators with terminators at the Last
while keeping in view the other symbol.
Integer is input from the user. Write a program to find out the number is
Even or Odd.
CODE:
OUTPUT:
5
BCE-IA Introduction to Programming
LAB TASK:
Write a Program using DEVC++ (Software) and also understand the basic
Operations.
Write header files at the top of Program.
Write the program by using extraction operators with terminators at the Last
while keeping in view the other symbol.
Input: Marks
Process: If Marks is greater than and equal to 75, score will A.
If Marks is less than 75 and Greater than and equal to 45, score will B.
If Marks is less than 60 and greater than and equal to 45, score will C.
If marks are less than 30, score will be D.
CODE:
6
BCE-IA Introduction to Programming
OUTPUT:
7
BCE-IA Introduction to Programming
8
BCE-IA Introduction to Programming
LAB TASK:
Write a Program using DEVC++ (Software) and also understand the basic
Operations.
Write header files at the top of Program.
Write the program by using extraction operators with terminators at the Last
while keeping in view the other symbol.
Write a program to check a number is Positive, Negative or Zero.
CODE:
OUTPUT:
9
BCE-IA Introduction to Programming
1
0
BCE-IA Introduction to Programming
LAB TASK:
Write a Program using DEVC++ (Software) and also understand the basic
Operations.
Write header files at the top of Program.
Write the program by using extraction operators with terminators at the Last
while keeping in view the other symbol.
Write a Program that show a Restaurant Menu.
CODE:
#include<iostream>
using namespace std;
int main()
{
cout<<"Welcome to the Resturant."<<endl;
char Food;
cout<<"There are three types of Food are availabel in our Resturant."<<endl;
cout<<"For Chinees Food Please Press C."<<endl;
cout<<"For italian Food Please Press I."<<endl;
cout<<"For Desi Food Please Press D."<<endl;
cin>>Food;
if (Food== 'C')
{
cout<<"You selected chinees."<<endl;
char Meal;
cout<<"In our Resturant there are two types of Chinees."<<endl;
cout<<"For Noodles Please press N."<<endl;
cout<<"For soup Please press S."<<endl;
cin>>Meal;
if (Meal== 'N')
{
cout<<"Your Order have been placed for Noodles."<<endl;
cout<<"Thank you!"<<endl;
}
else if (Meal== 'S')
{
cout<<"Your order have been placed for Soup."<<endl;
cout<<"Thank you!"<<endl;
}
}
if (Food== 'I')
1
1
BCE-IA Introduction to Programming
{
cout<<"You selected an Italian food"<<endl;
char Meal;
cout<<"In our Resturant there are two types of Italian."<<endl;
cout<<"For Pasta Please press P."<<endl;
cout<<"For Zinger Please press Z."<<endl;
cin>>Meal;
if (Meal== 'P')
{
cout<<"Your Order have been placed for Pasta."<<endl;
cout<<"Thank you!"<<endl;
}
else if (Meal== 'Z')
{
cout<<"Your Order have been placed for Zinger."<<endl;
cout<<"Thank you!"<<endl;
}
}
if (Food== 'D')
{
cout<<"You selected Desi"<<endl;
char Meal;
cout<<"In our Resturant there are two types of Desi."<<endl;
cout<<"For Biryani Please press B."<<endl;
cout<<"For Nan and Chany Please press N."<<endl;
cin>>Meal;
if (Meal== 'B')
{
cout<<"Your Order have been placed for Biryani."<<endl;
cout<<"Thank you!"<<endl;
}
else if (Meal== 'N')
{
cout<<"Your Order have been placed for Nan Chany."<<endl;
cout<<"Thank you!"<<endl;
}
}
else
{
cout<<"Invalid"<<endl;
}
1
2
BCE-IA Introduction to Programming
OUTPUT:
1
3
BCE-IA Introduction to Programming
1
4
BCE-IA Introduction to Programming
LAB TASK:
Write a Program using DEVC++ (Software) and also understand the basic
Operations.
Write header files at the top of Program.
Write the program by using extraction operators with terminators at the Last
while keeping in view the other symbol.
Find the Largest number among the three numbers.
CODE:
1
5
BCE-IA Introduction to Programming
OUTPUT:
CONCLUSIONS:
After Performing this lab, I am able to write any decision on
++
DevC .By performing all the Lab Task I understand that whenever I go to ATM or any
other Digital restaurant; Whenever I press any Button so what happened in the backend.
1
6