CSE 210: Programming with Classes

Foundation #2: Encapsulation with Online Ordering

Overview

The first principle of Programming with Classes is Encapsulation. For this assignment, you will write a program that demonstrates your knowledge of encapsulation.

Scenario

Assume you have been hired to help a company with their product ordering system. They sell many products online to a variety of customers and need to produce packing labels, shipping labels, and compute final prices for billing.

Program Specification

Write a program that has classes for Product, Customer, Address, and Order. The responsibilities of these classes are as follows:

Order
Product
Customer
Address
Other considerations

Make sure that all member variables are private and getters, setters, and constructors are created as needed.

Once you have created these classes, write a program that creates at least two orders with a 2-3 products each. Call the methods to get the packing label, the shipping label, and the total price of the order, and display the results of these methods.

User Interaction

The focus of the Foundation programs is to help you design and build the classes and work with the relationships among these classes. With that in mind, you do not need to create a menu system or a user interface. Instead, your Program.cs file should create the required objects, set their values, and display them as specified, without any user interaction.

Showing Creativity

Because the purpose of these Foundation programs is to help you practice the principles of the course in a very direct way, you are not expected to show creativity and exceed the core requirements the way you have in previous projects. You can earn 100% by completing the requirements as specified.

Develop the Program

In the course repository, find the Foundation2 project in the foundation folder and write your program there.

Submission Instructions

Because this project does not have any user interaction, for submission, you will include a screenshot of your program execution in your GitHub repository alongside the corresponding code. (For detailed instructions about capturing a screenshot, see the Foundation #1 program description.)

Once you have added your screenshot to your GitHub repository, return to Canvas to submit a link to your GitHub repo.