Starting Out with Java: Early Objects (6th Edition)
6th Edition
ISBN: 9780134462011
Author: Tony Gaddis
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Textbook Question
Chapter 3, Problem 2MC
A class is analogous to a(n) _______.
- a. house
- b. blueprint
- c. drafting table
- d. architect
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
A class may have several constructors and it is called __________.
Using Visual Studio
C# Language
Note: not a User Input
Create java code a new class called "Module" in which you add the following attributes:
Code
Name
Number_students
2.Create another class called principle_program in which you create two instances of the class Module called ITP and POP.
class principle_program
{
public static void main(String args[])
{
//create two instances of the class Module
}
}
Chapter 3 Solutions
Starting Out with Java: Early Objects (6th Edition)
Ch. 3.1 - In this chapter, we use the metaphor of a...Ch. 3.1 - Prob. 3.2CPCh. 3.1 - When a variable is said to reference an object,...Ch. 3.1 - A string literal, such as Joe, causes what type of...Ch. 3.1 - Prob. 3.5CPCh. 3.1 - Prob. 3.6CPCh. 3.1 - Prob. 3.7CPCh. 3.1 - Prob. 3.8CPCh. 3.1 - Prob. 3.9CPCh. 3.1 - What is a stale data item?
Ch. 3.3 - Assume that r1 and r2 are variables that reference...Ch. 3.4 - How is a constructor named?Ch. 3.4 - What is a constructors return type?Ch. 3.4 - Prob. 3.14CPCh. 3.8 - Prob. 3.15CPCh. 3.8 - When designing an object-oriented application, who...Ch. 3.8 - How do you identify the potential classes in a...Ch. 3.8 - What are a classs responsibilities?Ch. 3.8 - What two questions should you ask to determine a...Ch. 3.8 - Will all of a classs actions always be directly...Ch. 3 - This is a collection of programming statements...Ch. 3 - A class is analogous to a(n) _______. a. house b....Ch. 3 - An object is a(n) _____. a. blueprint b. attribute...Ch. 3 - This is a class member that holds data. a. method...Ch. 3 - This key word causes an object to be created in...Ch. 3 - This key word causes a value to be sent back from...Ch. 3 - This is a method that gets a value from a classs...Ch. 3 - This is a method that stores a value in a field or...Ch. 3 - When the value of an item is dependent on other...Ch. 3 - This is a method that is automatically called when...Ch. 3 - When a local variable has the same name as a...Ch. 3 - If you do not write a constructor for a class,...Ch. 3 - A classs responsibilities are __________. a. the...Ch. 3 - Prob. 14TFCh. 3 - True or False: When passing an argument to a...Ch. 3 - Prob. 16TFCh. 3 - True or False: Each instance of a class has its...Ch. 3 - True or False: When you write a constructor for a...Ch. 3 - True or False: To find the classes needed for an...Ch. 3 - Find the error in the following class: public...Ch. 3 - Prob. 2FTECh. 3 - The following statement attempts to create a...Ch. 3 - Design a class named Pet, which should have the...Ch. 3 - Look at the following partial class definition,...Ch. 3 - Look at the following description of a problem...Ch. 3 - What is the difference between a class and an...Ch. 3 - A contractor uses a blueprint to build a set of...Ch. 3 - What is an accessor method? What is a mutator...Ch. 3 - is it a good idea to make fields private? Why or...Ch. 3 - If a class has a private field, what has access to...Ch. 3 - Prob. 6SACh. 3 - Assume a program named MailList.java is stored in...Ch. 3 - Prob. 8SACh. 3 - Why are constructors useful for performing...Ch. 3 - Prob. 10SACh. 3 - What is the difference between an argument and a...Ch. 3 - Under what circumstances does Java automatically...Ch. 3 - What do you call a constructor that accepts no...Ch. 3 - Employee Class Write a class named Employee that...Ch. 3 - Car Class Write a class named Car that has the...Ch. 3 - Personal Information Class Design a class that...Ch. 3 - Temperature Class Write a Temperature class that...Ch. 3 - Retail Item Class Write a class named RetailItem...Ch. 3 - Payroll Class Design a Payroll class that has...Ch. 3 - TestScores Class Design a TestScores class that...Ch. 3 - Circle Class Write a Circle class that has the...Ch. 3 - Pet Class Design a class named Pet, which should...Ch. 3 - Patient Charges Write a class named Patient that...
Additional Engineering Textbook Solutions
Find more solutions based on key concepts
In this chapter, we have introduced some functions with, unsual call and return behaviors longjmp, execve, and ...
Computer Systems: A Programmer's Perspective (3rd Edition)
A file that contains a Flash animation uses the __________ file extension. a. .class b. .swf c. .mp3 d. .flash
Web Development and Design Foundations with HTML5 (9th Edition) (What's New in Computer Science)
Write a program to print the corresponding Celsius to Fahrenheit table.
C Programming Language
(Sum a Sequence of Integers) Write a program that sums a sequence of integers. Assume that the first integer re...
C How to Program (8th Edition)
Write an input validation loop that asks the user to enter a number in the range of 1 through 4,
Starting Out with Java: From Control Structures through Data Structures (3rd Edition)
For each of the following activities, give a PEAS description of the task environment and characterize it in te...
Artificial Intelligence: A Modern Approach
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- Chapter 10 defined the class circleType to implement the basic properties of a circle. (Add the function print to this class to output the radius, area, and circumference of a circle.) Now every cylinder has a base and height, where the base is a circle. Design a class cylinderType that can capture the properties of a cylinder and perform the usual operations on the cylinder. Derive this class from the class circleType designed in Chapter 10. Some of the operations that can be performed on a cylinder are as follows: calculate and print the volume, calculate and print the surface area, set the height, set the radius of the base, and set the center of the base. Also, write a program to test various operations on a cylinder.arrow_forwardQuestion 14 papa .use python Full explain this question and text typing work only We should answer our question within 2 hours takes more time then we will reduce Rating Dont ignore this linearrow_forwardAn interface is a collection of _______ that a class can implementarrow_forward
- Python Programming2. Write a class named Pet, which should have the following data attributes:(a). __name (for the name of a pet)__animal_type (for the type of animal that a pet is. Example values are ‘Dog’, ‘Cat’, and ‘Bird’)__age (for the pet’s age)The Pet class should have an __init__ method that creates these attributes. It should also have the following methods:(b). set_name: This method assigns a value to the __name field.set_animal_type: This method assigns a value to the __animal_type field.set_age: This method assigns a value to the __age field.get_name: This method returns the value of the __name field.get_animal_type: This method returns the value of the __animal_type field.get_age: This method returns the value of the __age field.arrow_forwardPYTHON CLASSES AND OBJECTarrow_forwardProgramming Language= PYTHON 3. Personal Information Class Design a class that holds the following personal data: name, address, age, and phone number. Write appropriate accessor and mutator methods. Also, write a program that creates three instances of the class. One instance should hold your information, and the other two should hold your friends’ or family members’ information. My information: Name: John Doe Address: 111 My Street Age: 22 Phone Number: 555-555-1281 Mom's information: Name: Mom Address: 222 Any Street Age: 52 Phone Number: 555-555-1234 Sis's infomation: Name: Jane Doe Address: 333 Her Street Age: 20 Phone Number: 555-555-4444 Dad's information: Name: Dad Address: 222 Any Street Age: 56 Phone Number: 555-254-5611arrow_forward
- In a population, the birth rate and death rate are calculated as follows:Birth Rate = Number of Births ÷ Population Death Rate = Number of Deaths ÷ PopulationFor example, in a population of 100,000 that has 8,000 births and 6,000 deaths 2per year,Birth Rate = 8,000 ÷ 100,000 = 0.08 Death Rate = 6,000 ÷ 100,000 = 0.06Design a Population class that stores a current population, annual number of births, and annual number of deaths for some geographic area. The class should allow these three values to be set in either of two ways: by passing arguments to a three-parameter constructor when a new Population object is created or by calling the set_population, set_births, and set_deaths class member functions. The class should also have get_birth_rate and get_death_rate functions that compute and return the birth and death rates. Write a short program that uses the Population class and illustrates its capabilities.Input Validation: If a population figure less than 2 is passed to the class, use…arrow_forwardFill-in-the-Blank A class may have more than one constructor, as long as each has a different_________.arrow_forwardThe pillar that allows you to build a specialized version of a general class, but violates encapsulation principles is ______________.arrow_forward
- Object Oriented Programming in JAVA You are part of a team writing classes for the different game objects in a video game. You need to write classes for the two human objects warrior and politician. A warrior has the attributes name (of type String) and speed (of type int). Speed is a measure of how fast the warrior can run and fight. A politician has the attributes name (of type String) and diplomacy (of type int). Diplomacy is the ability to outwit an adversary without using force. From this description identify a superclass as well as two subclasses. Each of these three classes need to have a default constructor, a constructor with parameters for all the instance variables in that class (as well as any instance variables inherited from a superclass) accessor (get) and mutator (set) methods for all instance variables and a toString method. The toString method needs to return a string representation of the object. Also write a main method for each class in which that class is…arrow_forwardPython Programming A- Define a class called Vehicle as follows: The Vehicle class has two instance variables: name, max_speed Define an __init__ function for the Vehicle class that initializes the name and max_speed instance variables Define get and set methods for each of the name and max_speed variables. You may call them getName, getMax_speed, setName and setMax_speed Define a __str__ function that prints the name and max_speed of the Vehicle class. B- Define a class called Car as follows: The Car class is a subclass of the Vehicle class. The Car class has an instance variable called number_of_cylinders Define an __init__ function for the Car class that initializes the name and max_speed and number_of_cylinders instance variables Please note that the Car class inherits the name and max_speed variables from the Vehicle class and does not redefine them. Define get and set methods for the number_of_cylinders variable. Define a __str__ function that prints the name and…arrow_forwardExercises abstract class • Design a new Triangle class that extends the abstract GeometricObject class: • Draw the UML diagram for the classes Triangle and GeometricObject • Implement the Triangle class • Write a test program that prompts the user to enter three sides of the triangle, a color, and a Boolean value to indicate whether the triangle is filled: • The program should create a Triangle object with these sides and set the color and filled properties using the input • The program should display the area, perimeter, color, and true or false to indicate whether it is filled or notarrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- EBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENTC++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage Learning
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning
Memory Management Tutorial in Java | Java Stack vs Heap | Java Training | Edureka; Author: edureka!;https://www.youtube.com/watch?v=fM8yj93X80s;License: Standard YouTube License, CC-BY