0% found this document useful (0 votes)
6 views4 pages

Programming Codes

The document outlines a pseudocode and Pascal program for a parcel billing system that collects customer information and calculates charges based on parcel type and billing mode. It processes up to 15 customer entries, calculating initial charges, processing fees, and final charges for each parcel. The program prompts the user for various inputs and displays the computed charges accordingly.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views4 pages

Programming Codes

The document outlines a pseudocode and Pascal program for a parcel billing system that collects customer information and calculates charges based on parcel type and billing mode. It processes up to 15 customer entries, calculating initial charges, processing fees, and final charges for each parcel. The program prompts the user for various inputs and displays the computed charges accordingly.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Psuedocode

Start

Declare Customers_name, Address, Parcel_type, Billing_mode as String


Declare Weight, Processing_fee, Delivery_fee, Total_processing_fee,
Initial_charge, Final_charge as Real
Declare Count as Integer

Processing_fee ← 5
Delivery_fee ← 10
Count ← 0

WHILE Count < 15 DO

Write "Enter Customer Name"


Read Customers_name

Write "Enter Address"


Read Address

Write "Enter Parcel Type"


Read Parcel_type

Write "Enter Weight"


Read Weight

Write "Enter Billing Mode"


Read Billing_mode

Initial_charge ← 0

IF Parcel_type = "Personal" AND Billing_mode = "Perlb" THEN


Initial_charge ← Weight * 10
ELSE IF Parcel_type = "Electronic" AND Billing_mode = "Flat Rate" THEN
Initial_charge ← Weight * 150
ELSE IF Parcel_type = "Auto Parts" AND Billing_mode = "Perlb" THEN
Initial_charge ← Weight * 15
END IF

Total_processing_fee ← Processing_fee + Delivery_fee


Final_charge ← Initial_charge + Total_processing_fee

Count ← Count + 1

Print "Customer Name:", Customers_name


Print "Address:", Address
Print "Parcel Type:", Parcel_type
Print "Weight:", Weight
Print "Billing Mode:", Billing_mode
Print "Charge:", Initial_charge
Print "Processing Fee:", Total_processing_fee
Print "Overall Total Charge:", Final_charge

END WHILE

Stop

Pascal code
program ParcelBilling;

var
Customers_name, Address, Parcel_type, Billing_mode: string;
Weight, Processing_fee, Delivery_fee: real;
Total_processing_fee, Initial_charge, Final_charge: real;
Count, Code: integer;
Temp: string;

begin
Processing_fee := 5;
Delivery_fee := 10;
Count := 0;

while Count < 15 do


begin
writeln('Enter Customer Name: ');
readln(Customers_name);

writeln('Enter Address: ');


readln(Address);

writeln('Enter Parcel Type (Personal / Electronic / Auto Parts): ');


readln(Parcel_type);

writeln('Enter Weight: ');


readln(Temp);
val(Temp, Weight, Code);

writeln('Enter Billing Mode (Perlb / Flat Rate): ');


readln(Billing_mode);

Initial_charge := 0;

if (Parcel_type = 'Personal') and (Billing_mode = 'Perlb') then


Initial_charge := Weight * 10
else if (Parcel_type = 'Electronic') and (Billing_mode = 'Flat Rate') then
Initial_charge := Weight * 150
else if (Parcel_type = 'Auto Parts') and (Billing_mode = 'Perlb') then
Initial_charge := Weight * 15;

Total_processing_fee := Processing_fee + Delivery_fee;


Final_charge := Initial_charge + Total_processing_fee;

Count := Count + 1;

writeln('Customer Name: ', Customers_name);


writeln('Address: ', Address);
writeln('Parcel Type: ', Parcel_type);
writeln('Weight: ', Weight:0:2);
writeln('Billing Mode: ', Billing_mode);
writeln('Charge: ', Initial_charge:0:2);
writeln('Processing Fee: ', Total_processing_fee:0:2);
writeln('Overall Total Charge: ', Final_charge:0:2);
end;

End.

Picture of pascal program running

You might also like