Thompson Rivers University
Customer Class
Assignment 3 Exceptions - SM 2025This class is used to store one line of survey data from the file. Each record includes the customer’s age and their satisfaction rating. The class is small, but it plays a key role in organizing and storing data cleanly.
public class Customer { }Private Attributes: age and rating
We add two attributes to store the customer’s information. These are kept private to follow encapsulation, which means we don’t allow other parts of the program to change the data directly. Instead, we use getter methods to access them.
Members only
Keep reading this lesson
You've reached the end of the free preview. Unlock the rest of this lesson plus 54 more lessons in Thompson Rivers University.
- Unlimited coding questions
- Unlimited access to all classroom material
- Weekly live call for questions and guidance
- 3,000 AI tutor tokens / month
- Personal SQL database (3 MB)
- Progress tracking
Cancel any time.