Professional Documents
Culture Documents
2. C) Storage Device
3. A) Temporary, Volatile
4. C) System Software
5. D) Pascal
6. C) Binary Numbers
8. A) Pseudocode, Flowchart
2) a) BEGIN
DECLARE char Name [50]; double Hours, Rate, Pay
INPUT Name, Hours, Rate
CALCULATE Pay = Hours * Rate
DISPLAY Name, Pay
END
b) BEGIN
DECLARE int emp=1, total=0; double salary
while (emp<= 10)
GET salary
CALCULATE total=total+salary, emp=emp+1
PRINT total
END
3) a) START
GET
height
COMPUTE area=0.5*base*height
END
b) START
DECLARE double p, m, v
INITIALIZE
m=1.50, v=4
CALCULATE p= m*v
DISPLAY
END
START
4)
while (steel<=5)
steel++
DISPLAY
weight
END
5) BEGIN
DECLARE double monthPay, timePeriod, loanAmount,
interest=0.05, totInterest, totLoan
GET loanAmount, timePeriod
CALCULATE
totInterest= (loanAmount*timePeriod)*interest;
monthPay= (loanAmount+totInterest)/(timePeriod*12);
DISPLAY monthPay
END
START
CALCULATE totInterest=(loanAmount*timePeriod)*interest;
monthPay=(loanAmount+totInterest)(timePeriod*12)
DISPLAY monthPay
END
6) BEGIN
DECLARE double length=9, width=4.5, height=5, mass=1800, density, volume
CALCULATE
volume=lenght*width*height;
density=mass/volume
DISPLAY density
END
START
CALCULATE
volume=length*width*height
density=mass/volume
DISPLAY density
END
7)
START
CALCULATE
force=mass*acc
DISPLAY force
END
8)
START
GET age
TRUE
If (age<=12) DISPLAY child
FALSE
DISPLAY “ADULT”
END
9) BEGIN
DECLARE double area, length, width; int rec=1
while (rec<=10)
GET length, width
CALCULATE area=length*width, rec++
DISPLAY area
END
10)
START
CALCULATE
voltage=current*resistance
DISPLAY voltage
END
DISCUSSION QUESTIONS
START
1. BEGIN
DECLARE double h, p, d; const int ATM=101325
const double G=9.81
GET h, d DECLARE double h, p, d; const int ATM=101325
CALCULATE p=ATM+h*d*G
DISPLAY p const double G=9.81
END
Output
pressure GET h, d
Input
height, density
Process
const double GRAVITY=9.81
CALCULATE
const double ATM=101325
double pressure, height, density p=ATM+h*d*G
pressure=ATM+height*density*GRAVITY
DISPLAY p
END
2. BEGIN
DECLARE double u=40, v=30, s=70, acc
CALCULATE acc = (pow(u,2) – pow (v,2)) / (2*s)
DISPLAY acc
END
Output
acc
Input
u=40, v=30, s=70
Process
double acc, u=40, v=30, s=70
acc= (pow(u,2) – pow (v,2)) / (2*s)
START
CALCULATE
DISPLAY acc
END
START
3. BEGIN
DECLARE double voltage, r , i ;
DECLARE double voltage, r, i
INITIALIZE r=2000, i =0.00175
CALCULATE voltage=i*r
DISPLAY voltage
END
INITIALIZE r=2, i=1.75
Output
voltage
Input
r=2000, i =0.00175 CALCULATE voltage=i*r
Process
double voltage, i , r
voltage=i*r
DISPLAY voltage
END
4.
START
Output Input Process
BEGIN
DECLARE double acc, force, mass
INITIALIZE mass=100, force=500
INITIALIZE mass=100, force=500
CALCULATE acc=force/mass
DISPLAY acc
END
CALCULATE acc=force/mass
DISPLAY acc
END
5.
BEGIN
DECLARE double speed, f, lam DECLARE double speed, f, Iam
INITIALIZE f=35, lam=0.7
CALCULATE speed=f*lam
DISPLAY speed
END
INITIALIZE f=35, Iam=0.7
CALCULATE speed=f*Iam
DISPLAY speed
END