Lab Report PF Lab
Lab Report PF Lab
PF LAB
SAMIULLAH
[Date]
SAMIULLAH
SECTION:A
LAB MANUAL 1
LAB TASK:
1: To make a profit, the prices of the items sold in a
furniture store are marked up by 80%. After marking up
the prices each item is put on sale at a discount of 10%.
Design an algorithm to find the selling price of an item
sold at the furniture store. What information do you need
to find the selling price?
STEP NO: 1
Let the original price be equal to x
STEP NO:2
The marked up price can be find by using following formula
Marked up price=x*1.8
STEP NO:3
The selling price can be found by using following formula
Selling price =(marked up price)*0.9
Selling price= x*1.8*0.9
Selling price=x*1.62
INFORMATION NEEDED:
Original price of the item
2: Jason typically uses the Internet to buy various items.
If the total cost of the items ordered, at one time, is $200
or more, then the shipping and handling is free;
otherwise, the shipping and handling is $10 per item.
Design an algorithm that prompts Jason to enter the
number of items ordered and the price of each item. The
algorithm then outputs the total billing amount.
STEP NO:1
Ask Jason to enter the number of items ordered and price of each item
STEP NO:2
Calculate the total cost by using formula
Total cost=no of item*price of each item
STEP NO:3
If the total cost is less than $200 than the shipping cost is 0
Otherwise, the shipping cost is $10 per item
Shipping cost=no of items*$10
STEP NO:4
The total bill is calculated by formula
Total bill=total cost + shipping cost
3: SUPPOSE THAT THE COST OF SENDING AN
INTERNATIONAL FAX IS CALCULATED AS FOLLOWS: THE
SERVICE CHARGE IS $3.00, $.20 PER PAGE FOR THE FIRST
10 PAGES, AND $0.10 FOR EACH ADDITIONAL PAGE.
DESIGN AN ALGORITHM THAT ASKS THE USER TO ENTER
THE NUMBER OF PAGES TO BE FAXED. THE ALGORITHM
THEN USES THE NUMBER OF PAGES TO BE FAXED TO
CALCULATE THE AMOUNT DUE.
STEP NO:1
Ask the user the mount of pages to be faxed
STEP NO:2
The cost of first 10 pages is given by
Cost(10)=no of pages*0.20
The cost of pages other than 10 is given by
Cost (>10)=no of pages*0.10
STEP NO:3
Total amount due is calculated by formula
Amount due=cost(10) + cost(>10)+ service charges
LAB MANUAL 2
LAB TASK
1. Write a C++ program to print your name, your date of birth, your email
address, your father name, your mobile number, your city your department and
any other information you want to display. All these information should be in
separate lines.
CODE:
#include <iostream>
#include <cstdlib>
int main()
cout<<"NAME:SAMIULLAH "<<endl;
cout<<"PHONE NO:03071598355\n";
cout<<"DEPARTMENT:computerscience
department\n";
cout<<"CITY:khushab\n";
sum=a+b;
subtract=a-b;
multiply=a*b;
cout<<"samiullah"<<endl;
cout<<"sum="<<sum<<endl;
cout<<"subtract="<<subtract<<endl;
cout<<"multiply="<<multiply<<endl;
}
CODE:
#include <iostream>
int main()
{ cout<<"samiullah"<<endl;
float c,f;
cin>>c;
f=(c*9/5)+32;
#include <iostream>
int main()
cout<<"samiullah"<<endl;
float r,c,PI;
PI=3.14;
cin>>c;
r=c/(2*PI);
int main()
cout<<"samiullah"<<endl;
float rp,dollor;
cin>>rp;
dollor=rp/278;
LAB MAUAL 3
1 .WRITE A PROGRAM IN C++ TO GET THE AGE OF THE
PERSON. THE PROGRAM SHOULD CALCULATE AND THE
DISPLAY THE AGE OF THE PERSON IN MONTHS.
PROGRAM:
#include<iostream>
#include<cstdlib>
using
namespace std;
int main() {
cout<<"NAME:SAMIULLAH"<<endl;
cout<<"24-cs-67"<<endl;
int age,age_month;
cin>>age;
age_month=12*age;
return 0;
}
2. WRITE A PROGRAM IN C++ TO GET THE MARKS OF THE
STUDENTS IN THREE SUBJECTS PROGRAMMING
FUNDAMENTAL, DIGITAL LOGIC DESIGN AND CIRCUIT
ANALYSIS. CALCULATE THE TOTAL AND AVERAGE MARKS
EACH SUBJECT HAS A MAXIMUM OF 100 MARKS
PROGRAM:
#include <iostream>
int main(){
cout<<"samiullah\n 24-cs-67"<<endl;
float pf,dsd,ca,total,avg;
cin>>pf;
cin>>dsd;
cin>>ca;
total=pf+dsd+ca;
avg=total/3;
#include<cstdlib>
using
namespace std;
int main() {
cout<<"samiullah\n 24-cs-67"<<endl;
float r,h,vol,PI=3.14;
cin>>r;
cin>>h;
vol=PI*h*r*r;
PROGRAM:
#include <iostream>
int main()
cout<<"samiullah\ncs-24-67"<<endl;
float f,c;
cin>>f;
c=(f-32)*5/9;
Lab manual