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 3MC
An object is a(n) _____.
- a. blueprint
- b. attribute
- c. variable
- d. instance
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
Rectangle Object Monitoring
Create a Rectangle class that can compute the total area of all the created rectangle objects using static fields (variables). Remember that a Rectangle has two attributes: Length and Width. Implement the class by creating a computer program that will ask the user about three rectangle dimensions. The program should be able to display the total area of the three rectangle objects. For this exercise, you are required to apply all OOP concepts that you learned in class.
Sample output:
Enter Length R1: 1
Enter Width R1: 1
Enter Length R2: 2
Enter Width R2: 2
Enter Length R3: 3
Enter Width R3: 3
The total area of the rectangles is 14.00
Note: All characters in boldface are user inputs.
A
field has access that is somewhere between public and private.
static
final
Opackage
Oprotected
When the contents of an object cannot be changed after it is created, the object is referred to as mutable.object that is abstract a variable object Encapsulation
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
Are the Book objects you have implemented immutable? Justify your answer.
Objects First with Java: A Practical Introduction Using BlueJ (6th Edition)
In a Python class, how do you hide an attribute from code outside the class?
Starting Out with Python (3rd Edition)
3.12 (Date Create a class called Date that includes three pieces Of information as data
members—a month (type ...
C++ How to Program (10th Edition)
Give an example of each of the following, other than those described in this chapter, and clearly explain why y...
Modern Database Management (12th Edition)
Budget Analysis Design a program that asks the user to enter the amount that he or she has budgeted for a month...
Starting Out with Programming Logic and Design (4th Edition)
Write a program to print the value of EOF.
C Programming Language
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
- One or more objects may be created from a(n) A. method B. instance C. class D. fieldarrow_forward1. Dummy GUI Application by Codechum Admin A GUI Application is an application that has a user interface that the user can interact with. For this program, we will be simulating this behavior. First, implement another class called Checkbox which implements the Clickable interface which has only one method: public void click(). The Checkbox will have the following properties: private boolean isChecked (defaults to false upon the creation of object) private String text Additionally, it should have the following methods: the implementation of the click() method If the isChecked is currently false, this will set the isChecked to true and will then print the message "Checkbox is checked". If it is currently true, this will set the isChecked to false and will then print the message "Checkbox is unchecked". Note that the messages to be printed should have also print a new line at the end. an override of the toString() method which returns the message: "Checkbox ({text} - Clicked…arrow_forwardclass Student(object): """Represents a student.""" def __init__(self, name, number): """All scores are initially 0.""" self._name = name self._scores = [] for count in range(number): self._scores.append(0) def getName(self): """Returns the student's name.""" return self._name def setScore(self, i, score): """Resets the ith score, counting from 1.""" self._scores[i - 1] = score def getScore(self, i): """Returns the ith score, counting from 1.""" return self._scores[i - 1] def getAverage(self): """Returns the average score.""" return sum(self._scores) / len(self._scores) def getHighScore(self): """Returns the highest score.""" return max(self._scores) def __str__(self): """Returns the string representation of the student.""" return "Name: " + self._name + "\nScores: " + \ " ".join(map(str, self._scores))arrow_forward
- When you instantiate an object from a class, you give a name to this particular object so that your program can distinguish it from other objects you instantiate from the same class. True Falsearrow_forwardFocus on classes, objects, methods and good programming style Your task is to create a BankAccount class(See the pic attached) The bank account will be protected by a 4-digit pin number (i.e. between 1000 and 9999). The pin should be generated randomly when the account object is created. The initial balance should be 0. get_pin()should return the pin. check_pin(pin) should check the argument against the saved pin and return True if it matches, False if it does not. deposit(amount) should receive the amount as the argument, add the amount to the account and return the new balance. withraw(amount) should check if the amount can be withdrawn (not more than is in the account), If so, remove the argument amount from the account and return the new balance if the transaction was successful. Return False if it was not. get_balance() should return the current balance. Finally, write a main() to demo your bank account class. Present a menu offering a few actions and perform the action the user…arrow_forwardPython Programming Questions (OOP): Write a class named “Bicycle” that has the following instance variables: gear, speed and brakes. This class will as well have the following methods: changeGearUp, changeGearDown, speedup, speedDown, applyBrakes, and printStates. The printStates method can print all of the current attributes of the bike object and brakes can be a Boolean type. Create an object named bike and test some of your methods/code that you have written with some output delivered to the user.arrow_forward
- Java - Constructors Create a class named Book that has the following attributes: Publisher - String Year Published - Integer Price - Double Title - String Create a constructor for the class Book that has the parameters from the attributes of the class. After, create a method for the class that displays all attributes. Ask the user for inputs for the attributes and use the constructor to create the object. Lastly, print the values of the attributes. Inputs 1. Publisher 2. Year Published 3. Price 4. Book Title XYZ Publishing 2020 1000.00 How to Win? Sample Output Published: ABC Publishing Year Published: 2022 Price: 150.00 Book Title: Stooping too low Stooping too low is published by ABC Publishing on 2022. It sells at the price of Php150.00.arrow_forwardStatic & Not Final Field: Accessed by every object, Changing Non-Static & Final Field: Accessed by object itself, Non-Changing Static & Final: Accessed by every object, Non-Changing Non-Static & Not Final Field: Accessed by object itself, ChangingRead the following situation and decide how the variables should be defined. You have a class named HeartsPlayerA round of Hearts starts with every player having 13 cardsPlayers then choose 3 cards to “trade” with a player (1st you pass left, 2nd you pass right, 3rd you pass across, 4th you keep)Players then strategically play cards in order to have the lowest scoreAt the end of the round, points are cumulatively totaled for each player.If one player’s total is greater than 100, the game ends and the player with the lowest score wins. 1. How should the following data fields be defined (with respect to final and static)?(a) playerPosition (These have values of North, South, East, or West)(b) directionOfPassing(c) totalScore…arrow_forwardA is a method that is automatically called when an object is instantiated.arrow_forward
- mau Open Leathing inta... - The class has data members that can hold the name of your cube, length of one of the sides and the color of your cube. - The class has a constructor that accepts the name, length of one of the sides, and color as arguments and sets the data members to those values. - The class has the following methods to set the corresponding data member. setName(string newName) setSide(double newSide) setColor(string newColor) - The class has a method called getVolume() that returns the volume of the cube, calculated by cubing the length of the side. - The class has a method called volumelncrease(double newVolume) that receive the percent the volume should increase, and then the side to the corresponding value. i - For example, 2.5 indicates 2.5% increasing of the volume. So you take the current volume, increase it by 2.5%, and then find the cube root to calculate the new side length. You can use the built in function called cbrt, part of the math library, to find the cube…arrow_forwardQuestion 7. Please create an object of CPlusPlus. The object name is myObject. class CPlusPlus { int n; 3; int main() { return 0; } Question 8 étv N MacBook Airarrow_forwardis a construct that defines objects of the same type. A class An object A method A data fieldarrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Programming with Microsoft Visual Basic 2017Computer ScienceISBN:9781337102124Author:Diane ZakPublisher:Cengage LearningMicrosoft Visual C#Computer ScienceISBN:9781337102100Author:Joyce, Farrell.Publisher:Cengage Learning,EBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENT
- Programming Logic & Design ComprehensiveComputer ScienceISBN:9781337669405Author:FARRELLPublisher:CengageEBK JAVA PROGRAMMINGComputer ScienceISBN:9781305480537Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENT
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:9781337102124
Author:Diane Zak
Publisher:Cengage Learning
Microsoft Visual C#
Computer Science
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Cengage Learning,
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Programming Logic & Design Comprehensive
Computer Science
ISBN:9781337669405
Author:FARRELL
Publisher:Cengage
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781305480537
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
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