Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5942387
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T16:14:45+00:00 2026-05-22T16:14:45+00:00

I am confuse here that how to make objects here in this scenario. I

  • 0

I am confuse here that how to make objects here in this scenario.
I am working with IPhone App.

Suppose, I have 2 main entities, STUDENTS and SUBJECTS , now there is many-to-many cardinality here. I have a to keep track of all the marks each student obtained in each subject.

So Database tables becomes 3 like this
STUDENT
SUBJECTS
STUDENTMARKS – (describe the association of student and subject)

Now ERD is clear to me, but I am confuse in OO Modeling here, that what objects/classes I need to make here, and how will they interact?
Please if some one can explain to me.

Thanks in Advance.

Edit:

How can only 2 classes fulfill my requirements? Let me explain:

Class subject contains all properties specifically related to subject, like its name, credit hours, class it is being teached to etc.

Class Student has its own specific properties like name, age, class enrolled in, etc etc.

Now where do I store this information that StudentA obtained 90 marks in SubjectA. As in case of DB I have another table for it, as in m-m relation.
So my question is, Should I also create a class of that 3rd table, say STUDENTMARKS as above , because the main student or subject object cant hold all info like studentA..to…StudentZ is enrolled in SubjectA, and all those student objects contain in Subject Object, but Where to store the marks of each student, because student object can’t have marks attribute, because marks is not directly/only related to student.

Can somebody please make a detailed skitch of classes for this considering Obj-C .

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T16:14:46+00:00Added an answer on May 22, 2026 at 4:14 pm

    Many to many, Student class will have ArrayList of Subject and Subject will have ArrayList of Student…If you offer particular subject twice in a year than Each Semester object will have Student list in it.

    public class Student{
    
       private ArrayList<Subject> current;
       private ArrayList<Subject> passed;
    
       ...
    }
    
    public class Subject{
    
       private ArrayList<Student> enrolled;
       private ArrayList<Student> passed;
    
       ...
    }
    

    Happy Coding

    Welcome to OO World!

    After your edition,

    You can Have. HashMap of inside Student class as an attribute.

    Like

    private HashMap<Subject,Integer> transcript....
    

    Here Subject is a key and Integer is a marks which student gets. If you want get marks from a srudent object for a spcific subject tha do this,

    S1.getScore(subject)
    

    Where s1 is Student object, subject is Subject class’s object.

    Inside Student class you can add method like,

    public Integer getScore(Subject sub){
        return transcript.get(sub);
    } 
    

    I apologize if indentation is not correct as I am writing this from mobile 😉

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Totally confused here. I have a PARENT UIViewController that needs to pass an NSMutableArray
I'm trying to make logging for my rails app and have some dilemmas over
I have created a BST full of WordInfo objects that have a vector to
C# 2008 I have been working on this for a while now, and I
I'm a bit confused here. Microsoft as far as I can tell claims that
I'm an absolute Silverlight noob that is confused by the help file. Here is
Bit confused here, I have an on-demand instance but do I get charged even
I am a little confused here. I would like to do something like this:
Just a little confused here... I have a function in postgres, and when I'm
I've confused myself nicely here. My scenario is as follows: function DesignPad() { function

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.