Title: Records Day 2
1Records Day 2
2Quick Review
Program RecordsExample type StudType
record namestring ageinteger gpareal
end var Student1,Student2Studtype begin writel
n(Please enter your name) readln(Student1.name)
writeln(Please enter your age) readln(Student
1.age) writeln(Please enter another
name) readln(Student2.name) writeln(Please
enter another age) readln(Student2.age) if
(Student1.age) gt (Student2.age)
then writeln(Student1.name, is
older) else writeln(Student1.name, is not
older ) Writeln(Student1) end.
ErrorPutting a here
ErrorForgetting the end.
Error
3Write the declarations (Type and var) for a
variable that needs to hold
- Team Name, School, Total score (For a swim meet,
wrestling meet, track meet, ) - Project Leader name, Three goals (Sentences),
Money allocated for the project, Project due
date. - Student name, Student ID number, Class schedule.
4First Record Program
- Using records Input an unknown number of Team
Names, Schools, and Total scores. - Output The winning team. That is the team with
the highest score. (If there is a tie, just show
the first team with the top score.)
5How would you
- Store a large group of records?
- How can you set it up?
- How can you access it?
6- program Sample1
- type
- rectype record
- ainteger
- breal
- end
- arraytype array1..5 of rectype
- var
- data arraytype
- count,x,yinteger
- begin
- for count 1 to 5 do
- begin
- datacount.a count
- datacount.b count 3
- end
- for count 1 to 5 do
- datacount.b datacount.b datacount.a
-
- for count 5 downto 1 do
- with datacount do
- writeln(a5, b52)
- for count 1 to 4 do
- begin
- datacount.a datacount1 .a
- datacount1.bdatacount.b
- end
- for count 1 to 5 do
- writeln(datacount.a,datacount.b52)
- end.
7Array of Record Assignment 1
- Define the record player_rec_type that holds
Name, score, rebounds and assists, - Create an array of records for 5 players
- Give initial values for each of the players (you
pick your method) - Show, from the array,the best scorer and best
rebounder and show all of the information about
that person.