Results 1 to 5 of 5

Thread: I need help with designing a program

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 2000
    Location
    England
    Posts
    2

    Question

    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

  2. #2
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    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.

  3. #3

    Thread Starter
    New Member
    Join Date
    Aug 2000
    Location
    England
    Posts
    2

    Cool

    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


  4. #4
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    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.

  5. #5
    Guest
    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
  •  



Click Here to Expand Forum to Full Width