Hey there! Sign in to join this conversationNew here? Join for free
    • Thread Starter
    Offline

    0
    ReputationRep:
    1. Design an object oriented representation (class) to model a student record at a university which contains the following properties/fields per student object:
    a. Student ID number (a long number e.g. 263712036)
    b. Student name (stored separately as firstname and lastname) (a text string e.g. “Dave Smith”)
    c. Date of birth (stored as a string e.g. 12/06/1993)
    d. Course enrolled on (course code as a string e.g. BSCWD)
    e. Contact number (a string e.g. 07766383726)
    f. List of average marks for each of three years of study (e.g. 59.8, 61.3, 63.4) – any empty marks would imply that the student had not completed a year yet
    g. Link to a picture of the student (a text string representing a file path e.g. “c:\data\263712036.jpg”


    2. Create a set of constructor methods which allow these properties to be passed when the new keyword is used to create a student record object or setter/getter properties which allow the properties/fields to be accessed.

    3. Create special public methods to return the following:

    a. String GetEmail() which returns the full email address as a string (firstname + . + lastname + “@edu.salford.ac.uk”)
    b. Float GetFinalGrade() Final degree grade (based on 0.25 * 2nd year mark + 0.75 * 3rd year mark – marks used in the calculation are from the list of three average marks stored in the object (point f. above)
    Online

    19
    ReputationRep:
    Google is your friend.

    I typed "Java class" but you can substitute Java for whatever language you are using. Here is one page
    https://docs.oracle.com/javase/tutor...pts/class.html

    Here is a page on constructors in C# (very similar to Java)
    https://msdn.microsoft.com/en-gb/library/ace5hbzh.aspx

    You probably need to know about a Date type (I typed Java date)
    http://www.tutorialspoint.com/java/java_date_time.htm

    So once you have read that lot, and assuming you went to the original class / lecture, you should be able to polish off your question in less than 30 minutes easily.

    Good luck!
 
 
 
  • See more of what you like on The Student Room

    You can personalise what you see on TSR. Tell us a little about yourself to get started.

  • Poll
    Has a teacher ever helped you cheat?
  • See more of what you like on The Student Room

    You can personalise what you see on TSR. Tell us a little about yourself to get started.

  • The Student Room, Get Revising and Marked by Teachers are trading names of The Student Room Group Ltd.

    Register Number: 04666380 (England and Wales), VAT No. 806 8067 22 Registered Office: International House, Queens Road, Brighton, BN1 3XE

    Write a reply...
    Reply
    Hide
    Reputation gems: You get these gems as you gain rep from other members for making good contributions and giving helpful advice.