|
-
Aug 7th, 2000, 12:15 PM
#1
Thread Starter
New Member
Help
I need to design a program that for 12 ficticous people, the age can be worked out from the birth date.
Also, included in the program will be a way to work out the average exam score from a total of seven results. I have already designed this part but am having problems coding it and don't know how to link it to the rest
I am very new to programing and desperately need help
Cheers
wardy
-
Aug 7th, 2000, 12:30 PM
#2
transcendental analytic
You could make an UDT like this one:
Code:
Type student
name as string
birth as date
exams(6) as integer
end type
for storing the data, then you could declare the fictious people like this
Code:
Private people(12) as student
and get the age of the x'th student:
Code:
Age=datediff("yyyy",people(x),now)
and the average:
Code:
dim n as integer,average as integer
For n=0 to 6
average=average+people(x).exams(n)
next n
average=average/7
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Aug 7th, 2000, 12:38 PM
#3
Thread Starter
New Member
Thanks for the great help
i'm not sure what objects i will need on my form, for example; will i need any command boxes e.t.c
Sorry if sound like a fool but as i say i am new to programming. Unfortunately my teacher at school does'nt care and thinks it would be fun for me to learn how to program in my summer holiday
-
Aug 7th, 2000, 01:22 PM
#4
transcendental analytic
Actually that depends on you, the interface you want to design, but i could help you.
make a listbox for the list of students
make another for exams
make three textboxes, for the name, the birthdate and the selected exam points.
make three commandbuttons, for adding a student, for applying the exams scores, for checking the age and the average score.
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Aug 7th, 2000, 05:54 PM
#5
If your exam is going to be out of 100%, then do not declare it as an Integer; declare it as a Byte instead. It will consume less memory.
Code:
Type Student
strName As String
dteBirth As Date
Exams(6) As Byte
End Type
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|