WWW.VIRTUALeMEDIA.COM

CONTACT US  |  HOMEPAGE

VIRTUALeMEDIA                                     TECHNOLOGY
CLOTHING  ::  ELECTRONICS  ::  HARDWARE  ::  GIFTS  ::  BOOKS  ::  FINANCE  ::  SOFTWARE  ::  EMPLOYMENT ::   VIRTUAL OFFICES
COOL STUFF

AUDIO

COMPUTERS

NETWORKS

PDAs

SUPPLIES

TELEVISIONS

WIRELESS

TECHNOLOGY

ARTICLES

HARDWARE

SOFTWARE

PROGRAMMING

WEBMARKETING

WIRELESS


LINKS

 
 

FREELANCING

VIRTUALeOFFICES

TRADELINKS

 

GEMINISOFTWARE

 

 

 

 

 

 

 

Allume Systems Software     Record Streaming Video. CLICK HERE!          SnapDialer: use cellphone to connect PC to the web     GEAR CD/DVD Burning Software     

_________________________________________________________________________________________

LearnKey Training

___________________

 

Welcome to our website

 

{$P256,G256}


{ THIS PASCAL PROGRAM PRINTS OUT A HISTOGRAM OF A PARTICULAR CLASSROOM }
{ AVERAGE. A '*' REPRESENTS THE NUMBER OF STUDENTS RECIEVING }
{ A CERTAIN GRADE. }



program histogram(input,output,infile,outfile);

const star = '*';

var i,class_id,numgrades,studentnum,grade,numtests : integer;
ave,no_A,no_B,no_C,no_D,no_F : integer;
lastnum : boolean;
infile,outfile : text;
symbol : char;

{******************************************************************}

procedure findlettergrade(var grade,numA,numB,numC : integer;
var numD,numF :integer);

begin { PROCEDURE HISTOGRAM }
case grade of
90..100 :numA := numA + 1; { this CASE statement is used }
80..89 : numB := numB + 1; { to sum up the number of }
70..79 : numC := numC + 1; { students recieving a certain}
60..69 : numD := numD + 1; { grade as shown. }
0..59 : numF := numF + 1;
end;
end; { HISTOGRAM }

{******************************************************************}

procedure drawbars(var histfile : text;length : integer;
barchar : char);

var count : integer;

begin { PROCEDURE DRAWBARS }
for count := 1 to length do
write(histfile,barchar); { THIS WRITES OUT AN '*' FOR }
writeln(histfile); { EACH SUM OF GRADES. }
end; { DRAWBARS }


{******************************************************************}

procedure average_grades(var grades_file :text;
var tests :integer; var average : integer;
score : integer);
var sum : integer;

begin { AVERAGE GRADES }
sum := 0;
for i := 1 to tests do
begin
read(grades_file,score);
sum := sum + score
end;
readln(grades_file);
average := sum DIV tests;
end; { AVERAGE GRADES }

{*****************************************************************}


begin { MAIN }
assign(infile,'LAB6.DAT' );
reset(infile);
assign(outfile, 'PRN' );
rewrite(outfile);
while not eof(infile) do
begin
lastnum := false; { LOOP CONTROL VARIABLE }
readln(infile,symbol,class_id,numtests);
no_A := 0;
no_B := 0;
no_C := 0;
no_D := 0;
no_F := 0;
writeln(outfile);
write(outfile,' COURSE : ',class_id);
writeln(outfile,' NUMBER OF TESTS : ',numtests);
read(infile,studentnum);
while not lastnum do { CHECKS FOR END OF CLASS GRADES }
begin
average_grades(infile,numtests,ave,grade);
findlettergrade(ave,no_A,no_B,no_C,no_D,no_F);
read(infile,studentnum);
if (studentnum = -999) then
begin
readln(infile);
lastnum := true;
end
else
lastnum := false;
end;
write(outfile, 'A : ' );
drawbars(outfile,no_A,star);{ THE NUMBER OF GRADES = LENGTH }
write(outfile, 'B : ' );
drawbars(outfile,no_B,star);
write(outfile, 'C : ' );
drawbars(outfile,no_C,star);
write(outfile, 'D : ' );
drawbars(outfile,no_D,star);
write(outfile, 'F : ' );
drawbars(outfile,no_F,star);
end;
close(infile);
close(outfile);
end.

 

_________________________________________________________________________________________

 

 

 

 

 

 

About Us

Content provided by VirtualeCorporation

 
 

 

 

Google

GeminiSoftwareSystems     GeminiMalls     GeminiMagazine     TradeLinks

VirtualeCatalog     VirtualeCorporation     VirtualeDirectory     VirtualeJobs     VirtualeMedia     VirtualeOffices

_______________________________________________________________________________________

Give to Charities Click Here!

Michael J. Fox Parkinson's Website Click Here!

__________________________________________

Software including hosting, websites, graphics, development, office, security..Click Here!

 

________________________________________________________________________________________

Save up to 75% on software     CoffeeCup Software     GoToMyPC - Access Your PC From Anywhere     Students software at 50% off!     Get New Emoticons     www.ITCFonts.com

 

Buy Online at Autodesk

"Internet Security Systems' BlackICE Protection Products"

 Need to create a business plan now? Get OfficeReady Business Plans

 Kaspersky Anti-Virus Products

 Free Shipping when you spend $100 on Macromedia.com

 Convert paper and PDF into Documents you can edit, share and archive - Buy OmniPage Pro from ScanSoft.

 Broderbund Bargain Bin - All Titles Under $9.99! Plus FREE shipping with orders over $20!

GameFly® Video Game Rentals - Free Trial          Free Stuff     Aces High 88 Button          

_____________________

Simpson's Monopoly

 

 

 

Google

 

 

 

 

© COPYRIGHT 2002 ALL RIGHTS RESERVED YOURDOMAIN.COM

CLOTHING  ::  ELECTRONICS  ::  HARDWARE  ::  GIFTS  ::  BOOKS  ::  FINANCE  ::  SOFTWARE  ::  EMPLOYMENT     VIRTUAL OFFICES