Professional Documents
Culture Documents
Ex. 1 Edited
Ex. 1 Edited
Algorithm:
STEP 1: Start
STEP 2: Get the unit value.
STEP 3: Compute if unit<=100 (energy charge=0,duty charge=0, fixed charge=0)
STEP 4: if unit <=200
Compute Energy_Charge=0+(unit-100)*1.5
Assign Duty_Charge=18
Assign Fixed_Charge=20)
STEP 5: if unit <=500
Compute Energy_Charge =0+(100*2)+(unit-200)*3
Assign Duty_Charge =48
Assign Fixed_Charge =30)
STEP 6: if unit>500
Compute Energy_Charge =0+(100*3.5)+(300*4.6)+(unit-500)*6.6
Assign Duty_Charge =50
Assign fixed charge=167.2)
STEP 7: Compute Total = Energy_Charge + Duty_Charge + Fixed_Charge.
STEP 8: Print total electricity bill to be paid.
STEP 9: Stop.
PSEUDE CODE:
BEGIN
GET THE UNIT VALUE
IF unit <=200
Energy_Charge =0+(unit-100)*1.5,
Duty_Charge =18,
Fixed_Charge =20)
IF unit <=500
Energy_Charge =0+(100*2)+(unit-200)*3,
Duty_Charge =48,
Fixed_Charge =30)
IF unit>500
Energy_Charge =0+(100*3.5)+(300*4.6)+(unit-500)*6.6,
Duty_Charge = 50
Fixed_Charge =167.2
COMPUTE Total = Energy_Charge + Duty_Charge + Fixed_Charge
PRINT Total
END IF
END
Result:
Thus, the algorithm, pseudocode and flowchart for electricity bill developed and drawn
successfully.
no No
Gst=total*8/100
if i < n
Main_total=gst+total
yes
Yes
Read product
name, quantity,
price Display
Main_total
subtotal=price*quantity
total=total+subtotal
Stop
i=i+1
Ex.No: DEVELOPING FLOW CHARTS FOR RETAIL SHOP BILLING
Date:
Aim:
To generate Algorithm, Pseudocode and develop Flowchart for Retail Shop Bill
ALGORITHM:
STEP 1: Start
STEP 2: Read number of items in ‘n’
STEP 3: Initialise i=0, total=0, amount=0
STEP 4: If i<=n
STEP 4.1: Print the quantity of item in ‘q’ and price in ‘p’
STEP 4.2: Total =(q*p)- discount
STEP 5: Set i=i+1
STEP 6: Else print amount= total+GST
STEP 7: Display
STEP 8: Stop
PSEUDO CODE:
BEGIN
READ item in “n”
INITIALISE i=0, total=0, amount=0
IF i<=n
PRINT the quantity of item in “q: and price in “p”
SET i=i+1
ELSE PRINT amount=total +GST
END IF
END
Result:
Thus, the Algorithm, Pseudocode and Flowchart for retail shop bill was developed
and drawn successfully.
Get x, n
Set i=0
c=1
no
No
yes if i<=n Print
sinx
Yes
c=c+1 Stop
Sinx=((-1)^c*x^i/i!
i=i+2
Ex.No: DEVELOPING FLOW CHARTS FOR SINE SERIES
Date:
Aim:
To generate Algorithm, Pseudocode and develop Flowchart for sine series.
ALGORITHM:
STEP 1: Start
STEP 2: Get x, n
STEP 3: Initialize set i=0 and c=0
STEP 4: If i< n
Increment c by 1
Compute Sinx=((-1)^c*x^i/i!)
Increment i by 2
Else
Display Sinx
STEP 5: Stop
PSEUDOCODE:
BEGIN
READ x, n
INITIALIZE Set i=0 and c=0
IF i<n
INCREMENT c by 1
CALCULATE Sinx=((-1)^c*x^i/i!)
INCREMENT i by 2
ELSE
DISPLAY Sinx
END IF
END
Result:
Thus, the Algorithm, Pseudocode and Flowchart for sine series was developed and
drawn successfully.
Get dry
weight DW
Get fuel
weight FW
Get rider
weight RW
Get passenger
weight pw
totalweight=DW+FW+RW+PW
Total load=totalweight+load No
M no
Yes
Print you are
Safe weight=GVWR-total if
yes appreciated for
saveweight
load safe load. Happy
>=0
journey
Ex.No: DEVELOPING FLOW CHARTS FOR WEIGHT OF THE MOTOR BIKE
Date:
Aim:
To generate Algorithm, Pseudocode and develop Flowchart for weight of the motor bike.
Algorithm:
STEP 1: Start
STEP 2: Get the GVWR of the particular vehicle as “GVRW”
Get the Dry weight as DW
Get the Fuel weight as FW
Get the Rider weight as RW
Get the Passenger weight as PW
STEP 3: Calculate the total weight of the vehicle by adding DW, FW, RW, PW
STEP 4: Get the load_weight as Load
STEP 6: Calculate the load_weight by adding the total weight with the load.
STEP 7: Calculate safe_weight by subtracting the total weight from GVWR.
STEP 8: Check if the safe weight is greater than or equal to zero.
If the condition is true then display “You are appreciated for safe load, HAPPY
JOURNEY”
If the condition is false then display “For safe journey reduce the weight for
better suspension” and goto step 4.
STEP 9: Stop.
Pseudocode:
BEGIN
GET GVWR, DW, FW, RW, PW
CALCULATE Total_weight = DW+FW+RW+PW
GET Load
CALCULATE Safe_weight = GVWR – Load_weight
IF Safe_weight>=0 THEN
DISPLAY “You are appreciated for safe load, Happy Journey”
ELSE
DISPLAY “For safe journey reduce the weight for better suspension”
STOP
Result:
Thus, the Algorithm, Pseudocode and Flowchart for weight of the motor bike developed
and drawn successfully.
Get d, l
Weight=d*d*l/162
Print
weight
Stop
Ex.No: DEVELOPING FLOW CHARTS FOR WEIGHT OF THE STEEL BAR
Date:
Aim:
To generate Algorithm, Pseudocode and develop Flowchart for weight of the steel
bar.
ALGORITHM:
STEP 1: Start
STEP 2: Get d, l
STEP 3: Calculate weight (d*d*l)/162
STEP 4: Print Weight
STEP 5: Stop
PSEUDO CODE:
BEGIN
GET d, l
CALCULATE Weight =(d*d*l)/162
PRINT Weight
END
Result:
Thus, the Algorithm, Pseudocode and Flowchart for weight of the steel bar was
developed and drawn successfully.
no
Yes
Get pf,i,v
Current=pf*i*v*3^1/2
Print
current
Stop
Ex.No: DEVELOPING FLOW CHARTS FOR 3PHASE ELECTRICITY BILL
Date:
Aim:
To generate algorithm, pseudocode and flowchart for 3 phase electricity bill
Algorithm:
STEP 1: Start
STEP 2: Get total watt of all appliance as n
STEP 3: If n >7500
Get pf, i, v
Calculate current=pf*i*3^1/2
Display current
Else
Display “Three phase current connection is not needed”
STEP 4: Stop
Pseudo code:
BEGIN
GET total watt of all appliance as n
IF n>7500
GET pf, i, v
COMPUTE current= pf*i*3^1/2
DISPLAY current
ELSE
DISPLAY “Three phase current connection is not needed”
END IF
END
Result:
Thus the algorithm and flowchart for 3 phase electricity bill developed successfully.