Garantie de satisfaction à 100% Disponible immédiatement après paiement En ligne et en PDF Tu n'es attaché à rien 4,6 TrustPilot
logo-home
Examen

Solution Manual for A Comprehensive Introduction to Object-Oriented Programming with Java 1st Edition by C Wu |ISBN: 9780073317083| Guide A+

Note
-
Vendu
-
Pages
184
Qualité
A+
Publié le
24-10-2025
Écrit en
2025/2026

Solution Manual for A Comprehensive Introduction to Object-Oriented Programming with Java 1st Edition by C Wu |ISBN: 9780073317083| Guide A+

Établissement
A Comprehensive Introduction To Object-Oriented Pr
Cours
A Comprehensive Introduction to Object-Oriented Pr

Aperçu du contenu

Solutions Manual For A
Comprehensive Introduction
to Object-Oriented
Programming with Java, 1e C.
Thomas Wu
JN
U
R
SE

, Chapter 1 Solutions

1.1 Graphically represent a Vehicle class and three Vehicle objects named car1, car2,
and car3.


Vehicle




car1:Vehicle car2:Vehicle car3:Vehicle




1.2 Graphically represent a Person class with the following components:
• Instance variables name, age, and gender.
JN
• Instance methods setName, getName, and getAge.
• Class method getAverageAge.

Person
setName()
U
name
getAge()
age age
R

getGender() gender
SE
gender

getAverageAge()
average age


1.3 Design a CD class where a CD object represents a single music CD. What kinds
of information (artist, genre, total playing time, etc.) do you want to know about a
CD? Among the information in which you are interested, which are instance
variables? Are there any class variables or class constants?

State
Album Name instance variable
Artist instance variable
Genre instance variable
Total Playing Time instance variable
Maximum Playing Time class constant

, Behaviors
getAlbumName(), setAlbumName() instance methods
getArtist(), setArtist() instance methods
getGenre(), setGenre() instance methods
getPlayingTime(), setPlayingTime() instance methods
getMaxPlayingTime() class method

Students may also include a list of songs on the CD and methods to access them.
A song itself would probably have its own class to represent it. However this
concept is more advanced than is necessary at this stage.

1.4 Suppose the Vehicle class in Exercise 1 is used in a program that keeps track of
vehicle registration for the Department of Motor Vehicles. What kinds of
instance variables would you define for such Vehicle objects? Can you think of
any useful class variables for the Vehicle class?

Instance variables
JN
owner
licenseID
registrationNumber
make
model
U
color
value
R
Class variables
At this stage, the number of total vehicles could be thought to belong to
the class. Information relating to the length of a licenseID or
SE
registrationNumber could be stored as class constants. Aside from these,
there are no obviously necessary traits for which all vehicles share the
same value or which the class may need to function.

1.5 Suppose the following formulas are used to compute the annual vehicle
registration fee for the vehicle registration program in Exercise 1.4:
• For cars, the annual fee is 2 percent of the value of the car.
• For trucks, the annual fee is 5 percent of the loading capacity (in
pounds) of the truck.
Define two new classes Car and Truck as subclasses of Vehicle.
Hint: Associate class and instance variables common to both Car and Truck to
Vehicle.

Vehicle Class
See Exercise 1.4

Car Class (subclass of Vehicle)
registrationRate class constant

, Note: Value is already an instance variable in Vehicle since all vehicles
have some value.

Truck Class (subclass of Vehicle)
registrationRate class constant
loadingCapacity instance variable

1.6 Consider a student registration program used by the registrar’s office. The
program keeps track of students who are registered for a given semester. For each
student registered, the program maintains the student’s name, address, and phone
number; the number of classes in which the student is enrolled and the student’s
total credit hours. The program also keeps track of the total number of registered
students. Define instance and class variables of a Student class that is suitable for
this program.

Instance variables
name
JN
address
phoneNumber
numClassesThisSemester
totalCreditHours
U
Class variables
numStudentsRegistered
R
1.7 Suppose the minimum and maximum number of courses for which a student can
register are different depending on whether the student is a graduate,
undergraduate, or work-study student. Redo Exercise 6 by defining classes for
SE
different types of students. Relate the classes using inheritance.

Student
See Exercise 1.6

GraduateStudent (subclass of Student)
maximumHours class constant
minimumHours class constant

UndergraduateStudent (subclass of Student)
maximumHours class constant
minimumHours class constant

WorkStudyStudent (subclass of Student)
maximumHours class constant
minimumHours class constant

Livre connecté

École, étude et sujet

Établissement
A Comprehensive Introduction to Object-Oriented Pr
Cours
A Comprehensive Introduction to Object-Oriented Pr

Infos sur le Document

Publié le
24 octobre 2025
Nombre de pages
184
Écrit en
2025/2026
Type
Examen
Contenu
Questions et réponses

Sujets

18,40 €
Accéder à l'intégralité du document:

Garantie de satisfaction à 100%
Disponible immédiatement après paiement
En ligne et en PDF
Tu n'es attaché à rien

Faites connaissance avec le vendeur

Seller avatar
Les scores de réputation sont basés sur le nombre de documents qu'un vendeur a vendus contre paiement ainsi que sur les avis qu'il a reçu pour ces documents. Il y a trois niveaux: Bronze, Argent et Or. Plus la réputation est bonne, plus vous pouvez faire confiance sur la qualité du travail des vendeurs.
JNURSE Chamberlain College Of Nursing
S'abonner Vous devez être connecté afin de pouvoir suivre les étudiants ou les formations
Vendu
214
Membre depuis
2 année
Nombre de followers
70
Documents
995
Dernière vente
1 semaine de cela
JNurse Libraries: Your Digital, Reliable and Excellent Nursing Partner

Welcome to JNURSE! The place to find the best study materials for various subjects. You can be assured that you will receive only the best which will help you to ace your exams. All the materials posted are A+ Graded. Please rate and write a review after using my materials. Your reviews will motivate me to add more materials. Thank you very much!

4,0

32 revues

5
20
4
3
3
2
2
4
1
3

Récemment consulté par vous

Pourquoi les étudiants choisissent Stuvia

Créé par d'autres étudiants, vérifié par les avis

Une qualité sur laquelle compter : rédigé par des étudiants qui ont réussi et évalué par d'autres qui ont utilisé ce document.

Le document ne convient pas ? Choisis un autre document

Aucun souci ! Tu peux sélectionner directement un autre document qui correspond mieux à ce que tu cherches.

Paye comme tu veux, apprends aussitôt

Aucun abonnement, aucun engagement. Paye selon tes habitudes par carte de crédit et télécharge ton document PDF instantanément.

Student with book image

“Acheté, téléchargé et réussi. C'est aussi simple que ça.”

Alisha Student

Foire aux questions