15100 Introductory Programming Practice Exam 3

# 15100 Introductory Programming Practice Exam 3 - 15-100...

• 2

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

15-100 Introductory/Intermediate Programming [CORTINA] 15-100 Sample Exam 3 NOTE: The sample questions below do not necessarily represent the exact questions you will receive on the exam, but they cover similar topics that you are expected to understand. 1. A basketball player has the following properties: height in feet and inches (e.g. 6 feet 9 inches), team name, and total points scored. (a) Complete the following field definitions for a class BasketballPlayer that models a basketball player: private __________ feet; private __________ inches; private __________ teamName; private __________ totalPoints; (b) Write a constructor for the BasketballPlayer class that creates and initializes a basketball player with 0 total points and a height in feet and inches and a team name that are supplied by parameters. If the feet or inches supplied is invalid, use a default height of 6 feet 6 inches instead. (Basketball players must be at least 6 feet 0 inches tall and at most 7 feet 11 inches tall.) (c) Write an accessor for the BasketballPlayer

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

This is the end of the preview. Sign up to access the rest of the document.
• Fall '12
• Cortina
• Subroutine, Natural number, Mutator method, 0 inches, 6 feet

{[ 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