Hello! friends today we will learn how to generate a bill for power holding corporation of Nigeria(PHCN), using Pascal programming language.
to start with, all you require is your pascal IDE to empower you to alter the code that I will indicate you underneath this.
thank you as, take after the progression
program bill;
uses crt;
var
fullname,accnum,address,tell,email,meternumb,acctype:string;
conpt,sumall,conpttype:integer;
vat,currentreading,previousreading,total,arrears,currentcharge:longint;
const
mainfee=200;
begin
writeln('******PORTHARCOURT ELECTRICITY DISTRUBUTION COMPANY********');
writeln('PLEASE PRESS ENTER TO CONTINUE');
writeln('ACCOUNT NUMBER');
readln(accnum);
writeln('NAME IN FULL');
readln(fullname);
writeln('ADDRESS');
readln(address);
writeln('MOBILE NUMBER');
readln(tell);
writeln('EMAIL');
readln(email);
writeln('METER NUMBER');
readln(meternumb);
readln;
writeln('*************BILL SUMMARY INFO**************');
readln;
writeln('CURRENT READING');
readln(currentreading);
writeln('PREVIOUS READING');
readln(previousreading);
writeln('ARREARS');
readln(arrears);
writeln('PRESS 1 IF YOUR A PRIVATE CONSUMER AND PRESS 2 IF YOUR AN INDUSTRIAL CONSUMER');
readln(conpttype);
conpt:=currentreading-previousreading;
if conpttype=1 then
writeln('YOU PICKED PRIVATE');
currentcharge:=5*conpt;
vat:=5*currentcharge;
total:=currentcharge+vat+mainfee+arrears;
writeln('CURENT BILL');
writeln('CONSUMPTION(KWH):',conpt);
writeln('CURRENT CHARGES(#):',currentcharge);
writeln('VAT(#):',vat);
writeln('PAY TOTAL DUE(#):',total);
if conpttype=2 then
writeln('YOU PICKED INDUSTRIAL');
currentcharge:=10*conpt;
vat:=5*currentcharge;
total:=currentcharge+vat+mainfee+arrears;
writeln('CURENT BILL');
writeln('CONSUMPTION(KWH):',conpt);
writeln('CURRENT CHARGES(#):',currentcharge);
writeln('VAT(#):',vat);
writeln('PAY TOTAL DUE(#):',total);
readln();
end.
to start with, all you require is your pascal IDE to empower you to alter the code that I will indicate you underneath this.
thank you as, take after the progression
program bill;
uses crt;
var
fullname,accnum,address,tell,email,meternumb,acctype:string;
conpt,sumall,conpttype:integer;
vat,currentreading,previousreading,total,arrears,currentcharge:longint;
const
mainfee=200;
begin
writeln('******PORTHARCOURT ELECTRICITY DISTRUBUTION COMPANY********');
writeln('PLEASE PRESS ENTER TO CONTINUE');
writeln('ACCOUNT NUMBER');
readln(accnum);
writeln('NAME IN FULL');
readln(fullname);
writeln('ADDRESS');
readln(address);
writeln('MOBILE NUMBER');
readln(tell);
writeln('EMAIL');
readln(email);
writeln('METER NUMBER');
readln(meternumb);
readln;
writeln('*************BILL SUMMARY INFO**************');
readln;
writeln('CURRENT READING');
readln(currentreading);
writeln('PREVIOUS READING');
readln(previousreading);
writeln('ARREARS');
readln(arrears);
writeln('PRESS 1 IF YOUR A PRIVATE CONSUMER AND PRESS 2 IF YOUR AN INDUSTRIAL CONSUMER');
readln(conpttype);
conpt:=currentreading-previousreading;
if conpttype=1 then
writeln('YOU PICKED PRIVATE');
currentcharge:=5*conpt;
vat:=5*currentcharge;
total:=currentcharge+vat+mainfee+arrears;
writeln('CURENT BILL');
writeln('CONSUMPTION(KWH):',conpt);
writeln('CURRENT CHARGES(#):',currentcharge);
writeln('VAT(#):',vat);
writeln('PAY TOTAL DUE(#):',total);
if conpttype=2 then
writeln('YOU PICKED INDUSTRIAL');
currentcharge:=10*conpt;
vat:=5*currentcharge;
total:=currentcharge+vat+mainfee+arrears;
writeln('CURENT BILL');
writeln('CONSUMPTION(KWH):',conpt);
writeln('CURRENT CHARGES(#):',currentcharge);
writeln('VAT(#):',vat);
writeln('PAY TOTAL DUE(#):',total);
readln();
end.
0 comments:
Post a Comment