100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached
logo-home
AP CSA UC Scout Semester 1 Final Questions With Complete Solutions $17.99   Add to cart

Exam (elaborations)

AP CSA UC Scout Semester 1 Final Questions With Complete Solutions

 1 view  0 purchase
  • Course
  • AP CSA UC
  • Institution
  • AP CSA UC

AP CSA UC Scout Semester 1 Final Questions With Complete Solutions

Preview 4 out of 88  pages

  • October 10, 2024
  • 88
  • 2024/2025
  • Exam (elaborations)
  • Unknown
  • AP CSA UC
  • AP CSA UC
avatar-seller
Classroom
AP CSA UC Scout Semester 1 Final Questions With
Complete Solutions

A car dealership needs a program to store information about the
cars for sale. For each car, they want to keep track of the
following information: number of doors (2 or 4), whether the car
has air conditioning, and its average number of miles per gallon.
Which of the following is the best object-oriented program
design?
Use one class, Car, with three instance variables:int numDoors,
boolean hasAir, and double milesPerGallon.
Use a class Car with three subclasses: Doors, AirConditioning,
and MilesPerGallon.
Use a class Car, with a subclass Doors, with a
subclassAirConditioning, with a subclass MilesPerGallon.
Use three classes: Doors, AirConditioning, and MilesPerGallon,
each with a subclass Car. Correct Answer Use one class, Car,
with three instance variables:int numDoors, boolean hasAir, and
double milesPerGallon.

A class always has a default constructor.
Correct! True
False Correct Answer True

A class always starts with a default constructor.
True
False Correct Answer True

A class has a default constructor when it is first created.
True
False Correct Answer true

,A code segment (not shown) is intended to determine the
number of players whose average score in a game exceeds 0.5.
A player's average score is stored in avgScore, and the number
of players who meet the criterion is stored in the variable count.
Which of the following pairs of declarations is most appropriate
for the code segment described?
double avgScore;boolean count;
int avgScore;int count;
double avgScore;double count;
double avgScore;int count; Correct Answer double avgScore;
int count;

A programmer has created an Employee class. The class
contains variables to represent the following.
A String variable called name to represent the name of the
employee
An int variable called age to represent the age of the employee
A String variable called gender to represent the gender of the
employee
A String variable called race to represent the race of the
employee
The object person will be declared as type Employee.
Which of the following descriptions is accurate?

An instance of the person class is Employee.
An attribute of the age object is int.
An instance of the Employee object is person.
Correct! An attribute of the person object is name. Correct
Answer An attribute of the person object is name. (CORRECT)

,A programmer has created an Employee class. The class
contains variables to represent the following.
A String variable called name to represent the name of the
employee
An int variable called age to represent the age of the employee
A String variable called gender to represent the gender of the
employee
A String variable called race to represent the race of the
employee
The object person will be declared as type Employee.
Which of the following descriptions is accurate?
An attribute of the person object is name.
An instance of the Employee object is person.
An instance of the person class is Employee.
An attribute of the age object is int. Correct Answer An
attribute of the person object is name.

A student has created a Cat class. The class contains variables to
represent the following:
A String variable called breed to represent the breed of a Cat
object
An int variable called age to represent the age of a Cat object
A String variable called name to represent the name of a Cat
object
The object is declared as type Cat and has the reference variable
pet. Which of the following descriptions is accurate?
An instance of the pet class is Cat.
An instance of the Cat class is pet.
An attribute of the name object is String.
An attribute of the Cat instance is pet. Correct Answer An
instance of the Cat class is pet.

, A student has created a Cat class. The class contains variables to
represent the following.
A String variable called breed to represent the breed of a Cat
object
An int variable called age to represent the age of a Cat object
A String variable called name to represent the name of a Cat
object
The object is declared as type Cat and has the reference variable
pet. Which of the following descriptions is accurate?
An attribute of the Cat instance is pet.
An instance of the pet class is Cat.
An attribute of the pet class is name.
Correct! An instance of the Cat class is pet.
An attribute of the name object is String. Correct Answer An
instance of the Cat class is pet.

A student has created a Person class. The class contains
variables to represent the following:
A String variable called name to represent the name of a Person
object
An int variable called age to represent the age of a Person object
A String variable called gender to represent the gender of a
Person object
The object is declared as type Person and has the reference
variable p1. Which of the following descriptions is accurate?
An attribute of the Person object is String.
An instance of the Person class is name.
An attribute of the Person instance is p1.
An attribute of the Person instance is age. Correct Answer An
attribute of the Person instance is age.

The benefits of buying summaries with Stuvia:

Guaranteed quality through customer reviews

Guaranteed quality through customer reviews

Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.

Quick and easy check-out

Quick and easy check-out

You can quickly pay through credit card or Stuvia-credit for the summaries. There is no membership needed.

Focus on what matters

Focus on what matters

Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!

Frequently asked questions

What do I get when I buy this document?

You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.

Satisfaction guarantee: how does it work?

Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.

Who am I buying these notes from?

Stuvia is a marketplace, so you are not buying this document from us, but from seller Classroom. Stuvia facilitates payment to the seller.

Will I be stuck with a subscription?

No, you only buy these notes for $17.99. You're not tied to anything after your purchase.

Can Stuvia be trusted?

4.6 stars on Google & Trustpilot (+1000 reviews)

75759 documents were sold in the last 30 days

Founded in 2010, the go-to place to buy study notes for 14 years now

Start selling
$17.99
  • (0)
  Add to cart