Week 2 Discussion Problems

# Week 2 Discussion Problems - Week 2 Discussion Problems...

This preview shows pages 1–2. Sign up to view the full content.

Week 2 Discussion Problems Designing and Implementing Classes 1. a) Design a Quiz class. The quiz has the following properties and methods: Item Description QuizName Property Holds the Name of the quiz, such as Quiz 1 TotalPossible Property This holds the total possible points on the quiz. Mark Property This property holds an individual’s points on the quiz CalcPercent Method This method has no parameters; all it does is divide the Mark by the TotalPossible and sends the resulting percent back to the calling program a) Design the class showing its name, properties and class methods b) Design the pseudo code or flowchart for the method c) Describe or create a windows form that would be capable of getting values for all properties and displaying the output of the method. d) What is the flowchart or pseudo code for the button click in this windows form/driver program? 2. Design a Lease class that has the following properties and methods: Item Description TenantNameProperty Holds the Name of the tenant Rent Property Holds the amount of the monthly rent DailyLateFee Holds the daily late charge for late payment of rent CalcTotalRent Method This method has one parameter – the number of days late. It uses this formula to arrive at the TotalRent including late fees: TotalRent= Rent + NumDaysLate*DailyLateFee It returns TotalRent to the calling program a) Design the class showing its name, properties and class methods b) Design the pseudo code or flowchart for the method c) Describe or create a windows form that would be capable of getting values for all properties and displaying the output of the method. d) What is the flowchart or pseudo code for the button click in this windows form/driver program? 3. Design a Company Class with the following properties and methods: Item Description CompanyName Holds the Name of the company AnnualSales Holds the annual sales of the company in dollars Annual Expenses Holds the total expenses for the year CalcProfit This method accepts no parameters, but calculates profit by subtracting the Annual Expenses from the Annual Sales. It returns the Profit to the calling program.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern