0% found this document useful (0 votes)
21 views

Lab Report PF Lab

Vgghhg my ggggggggffffddfgvvf vvgggggg&ff bff BBQ RV c FB BB gg Debbie jibboom kk Reese's was SC eh eh FB
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views

Lab Report PF Lab

Vgghhg my ggggggggffffddfgvvf vvgggggg&ff bff BBQ RV c FB BB gg Debbie jibboom kk Reese's was SC eh eh FB
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 12

LAB REPORT

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>

using namespace std;

int main()

cout<<"NAME:SAMIULLAH "<<endl;

cout<<"DATE OF BIRTH:10 OCTUBER


2006"<<endl;

cout<<"EMAIL ID: [email protected]\n";

cout<<"FATHER NAME:Maqsood AHMAD\n";

cout<<"PHONE NO:03071598355\n";

cout<<"DEPARTMENT:computerscience
department\n";

cout<<"CITY:khushab\n";

2.Write a computer program to add , Subtract and multiply two


numbers and display their results on the screen.
CODE:
#include<iostream>
using namespace std;
int main()
{int a,b,sum,subtract,multiply;
a=5,b=5;

sum=a+b;
subtract=a-b;
multiply=a*b;
cout<<"samiullah"<<endl;
cout<<"sum="<<sum<<endl;
cout<<"subtract="<<subtract<<endl;
cout<<"multiply="<<multiply<<endl;
}

3. WRITE A C++ PROGRAM TO CONVERT THE


CELSIUS TEMPERATURE TO FAHRENHEIT.

CODE:
#include <iostream>

using namespace std;

int main()

{ cout<<"samiullah"<<endl;

float c,f;

cout<<"plz enter the value of


celsius"<<endl;

cin>>c;

f=(c*9/5)+32;

cout<<"The value of fahrenheit is="<<f<<endl; }


4. Write a program to calculate the radius of the circle
CODE:

#include <iostream>

using namespace std;

int main()

cout<<"samiullah"<<endl;

float r,c,PI;

PI=3.14;

cout<<"plz enter the


circumference of the circle"<<endl;

cin>>c;

r=c/(2*PI);

cout<<"the radius opf circle is ="<<r<<endl;

5. Write a program in C++ by taking the amount in rupees


and convert it into dollars and print the result on the
screen.
CODE:
#include <iostream>

using namespace std;

int main()

cout<<"samiullah"<<endl;

float rp,dollor;

cout<<"plz enter the amount of


rupees"<<endl;

cin>>rp;
dollor=rp/278;

cout<<"amount in dollors is ="<<dollor<<endl;

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;

cout<<"plz enter your age"<<endl;

cin>>age;

age_month=12*age;

cout<<"age in months is ="<<age_month<<endl;

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>

using namespace std;

int main(){

cout<<"samiullah\n 24-cs-67"<<endl;

float pf,dsd,ca,total,avg;

cout<<"plz enter programming


fundamental marks"<<endl;

cin>>pf;

cout<<"plz enter digital logical design


marks"<<endl;

cin>>dsd;

cout<<"plz enter circuit ananlysis


marks"<<endl;

cin>>ca;

total=pf+dsd+ca;

avg=total/3;

cout<<"total marks are = "<<total<<endl;

cout<<"avg marks are = "<<avg<<endl;

3.WRITE A PROGRAM IN C++ TO COMPUTE AND PRINT


THE VOLUNE OF A CYLINDER WHERE "R" IS THE RADIUS
AND "H" IS THE HEIGHT AND THESE VALUES ARE
PROVIDED BY THE USER AT RUNTIME. (VOL-NHR² AND A-
3.14).
PROGRAM:
#include<iostream>

#include<cstdlib>

using

namespace std;

int main() {

cout<<"samiullah\n 24-cs-67"<<endl;

float r,h,vol,PI=3.14;

cout<<"plz enter radius of the


cylinder"<<endl;

cin>>r;

cout<<"plz enter height of the cylinder "<<endl;

cin>>h;

vol=PI*h*r*r;

cout<<"the volume of cylinder is ="<<vol<<endl;

WRITE A PROGRAM IC C++ TO READ THE TEMPERATURE


IN FAHRENHEIT.CONVERT THE TEMPERATURE IN CELCIUS
DEGREES BY USING FORMULA.

PROGRAM:
#include <iostream>

using namespace std;

int main()

cout<<"samiullah\ncs-24-67"<<endl;

float f,c;

cout<<"plz enter temperature in


Fahrenheit"<<endl;

cin>>f;
c=(f-32)*5/9;

cout<<"temp in celcius is ="<<c<<endl;

Lab manual

You might also like