Bifalgorithm post · Computer science one · Encapsulation & Objects
What problems arise when modeling students with separate variables and arrays?
What problems arise when modeling students with separate variables and arrays? (Computer science one · Encapsulation & Objects) — "As a motivating example, sup…
Ideas in this flowchart
- Organizing student enrollment reveals difficulties in representing student data.
- Modeling one student requires a collection of related variables.
- The variables may include first name, last name, GPA, and a unique identification number.
- These attributes can use strings, a floating-point number, and an integer.
- The attributes are stored in separate, unrelated variables even though they represent one entity.
- Tracking a collection of students requires representing many student entities.
- Each attribute must be stored in a separate array.
- Sorting the data requires manual bookkeeping to keep each student's attributes aligned at the same array index.
- Functions must receive multiple arrays to work with the student data.
- Modeling entities with more pieces of data makes the organization increasingly complex.