Starting Out with Java: From Control Structures through Data Structures (4th Edition) (What's New in Computer Science)
4th Edition
ISBN: 9780134787961
Author: Tony Gaddis, Godfrey Muganda
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Concept explainers
Expert Solution & Answer
Chapter 14.1, Problem 14.12CP
Program Description Answer
The subclass not present in “Shape” class is “Triangle”.
Hence, the correct answer is option “C”.
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
Hello!
Need some help with this assignment as it's stumped me quite a bit. I attached the images.
Need to create some classes and have the exact sample output( see image )
In Java please and thank you!
Please check the question with the given image and revised it if the code is complete. If not, please add what is missing. Please add comments on what you did. in Java eclipse.
please see the code below:
class Computer { private String model; private String brandName; private String manufacturingDate; private int numberOfCores;
public Computer() { }
public Computer(String model, String brandName, String manufacturingDate, int numberOfCores) { this.model = model; this.brandName = brandName; this.manufacturingDate = manufacturingDate; this.numberOfCores = numberOfCores; }
public String getModel() { return model; }
public void setModel(String model) { this.model = model; }
public String getBrandName() { return brandName; }
public void setBrandName(String brandName) { this.brandName = brandName; }
public String getManufacturingDate() { return manufacturingDate; }…
In JAVA, do not use Liang's BallPane Class. Just draw a circle.
Any and all help is appreciated, please also show the results with your code. Please see the attached image.
Chapter 14 Solutions
Starting Out with Java: From Control Structures through Data Structures (4th Edition) (What's New in Computer Science)
Ch. 14.1 - Prob. 14.1CPCh. 14.1 - Prob. 14.2CPCh. 14.1 - Prob. 14.3CPCh. 14.1 - Prob. 14.4CPCh. 14.1 - In what package is the Color class?Ch. 14.1 - Prob. 14.6CPCh. 14.1 - Prob. 14.7CPCh. 14.1 - Prob. 14.8CPCh. 14.1 - Prob. 14.9CPCh. 14.1 - Prob. 14.10CP
Ch. 14.1 - Prob. 14.11CPCh. 14.1 - Prob. 14.12CPCh. 14.2 - Prob. 14.13CPCh. 14.2 - Prob. 14.14CPCh. 14.2 - Prob. 14.15CPCh. 14.2 - Prob. 14.16CPCh. 14.2 - Prob. 14.17CPCh. 14.2 - Prob. 14.18CPCh. 14.2 - Prob. 14.19CPCh. 14.2 - Prob. 14.20CPCh. 14.2 - Prob. 14.21CPCh. 14.3 - Prob. 14.22CPCh. 14.3 - Prob. 14.23CPCh. 14.3 - Prob. 14.24CPCh. 14.3 - Prob. 14.25CPCh. 14.3 - Prob. 14.26CPCh. 14.3 - Prob. 14.27CPCh. 14.3 - Prob. 14.28CPCh. 14.3 - Prob. 14.29CPCh. 14.3 - Prob. 14.30CPCh. 14.4 - What two classes do you use to play an audio file?Ch. 14.4 - Refer to your answer to Checkpoint 14.31. In what...Ch. 14.4 - Prob. 14.33CPCh. 14.4 - Prob. 14.34CPCh. 14.5 - What three classes do you use to play a video...Ch. 14.5 - Refer to your answer to Checkpoint 14.35. In what...Ch. 14.5 - Prob. 14.37CPCh. 14.6 - Prob. 14.38CPCh. 14.6 - Prob. 14.39CPCh. 14.6 - What type of event happens when the user presses...Ch. 14.6 - What KeyEvent method can you call to determine...Ch. 14.6 - Refer to your answer for Checkpoint 14.41. What...Ch. 14 - Line, Circle, and Rectangle are subclasses of...Ch. 14 - Prob. 2MCCh. 14 - Prob. 3MCCh. 14 - Prob. 4MCCh. 14 - Prob. 5MCCh. 14 - Prob. 6MCCh. 14 - Prob. 7MCCh. 14 - Prob. 8MCCh. 14 - This interpolator causes an animation to start...Ch. 14 - You use these two classes to play an audio file....Ch. 14 - Prob. 11TFCh. 14 - Prob. 12TFCh. 14 - True or False: If an ellipses X-radius and...Ch. 14 - Prob. 14TFCh. 14 - Prob. 15TFCh. 14 - Write a statement that instantiates the Line...Ch. 14 - Write a statement that instantiates the Circle...Ch. 14 - Prob. 3AWCh. 14 - Write code that does the following: Instantiates...Ch. 14 - Prob. 5AWCh. 14 - Write a statement that instantiates the Text...Ch. 14 - Prob. 7AWCh. 14 - Assume myBox is a Rectangle object. Write the code...Ch. 14 - Write code that creates a Circle, with a radius of...Ch. 14 - Prob. 10AWCh. 14 - Prob. 11AWCh. 14 - Prob. 1SACh. 14 - Prob. 2SACh. 14 - Prob. 3SACh. 14 - Prob. 4SACh. 14 - Prob. 5SACh. 14 - Prob. 6SACh. 14 - What RotateTransition class method do you use to...Ch. 14 - Prob. 8SACh. 14 - Prob. 9SACh. 14 - Prob. 10SACh. 14 - Prob. 11SACh. 14 - Prob. 1PCCh. 14 - Tree Age Counting the growth rings of a tree is a...Ch. 14 - Hollywood Star Make your own star on the Hollywood...Ch. 14 - Prob. 4PCCh. 14 - Solar System Use the Circle class to draw each of...Ch. 14 - Prob. 6PCCh. 14 - Prob. 7PCCh. 14 - Prob. 8PCCh. 14 - Coin Toss Write a program that simulates the...Ch. 14 - Lunar Lander The books online resources...Ch. 14 - Change for a Dollar Game The books online...Ch. 14 - Rock, Paper, Scissors Game Write a program that...
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
- PLEASE ENSURE TO USE THE FRAMEWORK PROVIDED IN THE IMAGES, AND THAT IT WORKS WITH THE TESTER CLASS. Write a class RangeInput that allows users to enter a value within a range of values that is provided in the constructor. An example would be a temperature control switch in a car that allows inputs between 60 and 80 degrees Fahrenheit. The input control has “up” and “down” buttons. Provide up and down methods to change the current value. The initial value is the midpoint between the limits. As with the preceding exercises, use Math.min and Math.max to limit the value. Write a sample program that simulates clicks on controls for the passenger and driver seats.arrow_forwardIn Blue j Create a new class named Scene.Add a main method to the Scene class that simply creates a new Scene object Add a public method named animate that has no parameter variables and returns nothing. Add two House fields to Scene. Call them house1 and house2.Add a sun field that can reference a Circle object. Add a moon field that can reference a Circle object. Create a no-arg constructor for the Scene class that creates the two House objects shown in the imagebelow. Use the methods you created in the preceding activity to position and color the houses exactlyas in the image. We will adopt the convention that house1 refers to the left house and house2 refersto the right house. Add a sun to the upper-left corner of the scene. (Create the sun object and set the color, position, andsize in the no-arg constructor.) When you run main, what appears in the resulting image should match the above…arrow_forwardI need help creating a Java code package in Cube and Square classes as described in the image below package objectsPackage; import interfacePackage.ShapesInterface; public class Cube implements ShapesInterface { privatefinaldoubleLENGTH; privatefinaldoubleWIDTH; privatefinaldoubleHEIGHT; privatefinaldoubleVOLUME; privatefinaldoubleSURFACE_AREA; privatefinaldoubleBASE_AREA; privatefinal String SHAPE = "Cube"; public Cube() { this.HEIGHT = Math.random() * 10; this.LENGTH = calculateLength(); this.CUBE_AREA = calculateConeArea(); this.BASE_AREA = calculateBaseArea(); this.SURFACE_AREA = calculateSurfaceArea(); this.VOLUME = calculateVolume(); } @Override publicdouble getArea() { // TODO Auto-generated method stub returnthis.SURFACE_AREA; } @Override publicdouble getVolume() { // TODO Auto-generated method stub returnthis.VOLUME; } @Override publicvoid displayArea() { System.out.printf("This is a %s with an area of %3.2f square units%n",SHAPE, SURFACE_AREA); } @Override…arrow_forward
- Write a GUI in Java that will let the user sample borders. Include a menu named Borders that offers three options—beveled border, etched border, and line border—as submenus with the following options: • Beveled-border submenu options: raised or lowered. • Etched-border submenu options: raised or lowered. • Line-border submenu options: small, medium, or large. Each of these options should be a submenu with three color options: black, red, and blue. Put the borders around a label containing text that describes the border, such as Raised Border, Lowered Etched Border, and so forth. Fix the highlight and shadow colors for the etched-border options to whatever colors you like, and make the small line border 5 pixels wide, the medium one 10 pixels wide, and the large one 20 pixels widearrow_forwardWrite a GUI in Java that will let the user sample borders. Include a menu named Borders that offers three options—beveled border, etched border, and line border—as submenus with the following options: • Beveled-border submenu options: raised or lowered. • Etched-border submenu options: raised or lowered. • Line-border submenu options: small, medium, or large. Each of these options should be a submenu with three color options: black, red, and blue.Put the borders around a label containing text that describes the border, such as Raised Border, Lowered Etched Border, and so forth. Fix the highlight and shadow colors for the etched-border options to whatever colors you like, and make the small line border 5 pixels wide, the medium one 10 pixels wide, and the large one 20 pixels wide.arrow_forwardAssuming that MotorBicycle is a subclass of Bicycle, select all of the codes that overload the applyBrake method. To better view the option, right-click the image and select "Open image in new tab."arrow_forward
- we are going to create a new subclass of the SimpleGeometricObject class, namedTriangle. Create a Triangle class that extends the SimpleGeometricObject class in Eclipse, followingthe below UML diagram. (seperate code) Use the following formula to calculate the area of a triangle:A = 1/2 × base × height the SimpleGeometricObject code is below in link and picture https://liveexample.pearsoncmg.com/html/SimpleGeometricObject.html the ending part of the code that didnt appear in the picture } /** Return a string representation of this object */ public String toString() { return "created on " + dateCreated + "\ncolor: " + color + " and filled: " + filled; } }arrow_forwardThere needed to fix something in the above solution. Please repost the solution with these changes. Thank you!! Use Bootstrap classes to make a circular image with a border around the image only.arrow_forwardFor simple usage of GUIs, why would the source codes (shown below) not work? The input/output objects have not been properly handled. The data type of the methods has been defined in a wrong way. The necessary parameters in the methods have not been assigned properly. The flow of execution has been applied in a wrong way. import javax.swing.JOptionPane; public class Palindrome { public static void main(String[] args) //main method { long num1, num2; //variables to store the numbers String inputStr, outputStr; // strings to receive from the user // and display inputStr=JOptionPane.showInputDialog("Enter the number: "); num1 = Long.parseLong(inputStr); // change the string to num2 = num1; // numbers if (num1 <= 0) { num1 = - num1; //if the numbers are negative, change the sign inputStr = inputStr.valueOf(num1);//change the…arrow_forward
- For simple usage of GUIs, why would the source codes (shown below) not work?(a) The input/output objects have not been properly handled.(b) The data type of the methods has been defined in a wrong way.(c) The necessary parameters in the methods have not been assigned properly.(d) The flow of execution has been applied in a wrong way. import javax.swing.JOptionPane;public class Palindrome{public static void main(String[] args) //main method{long num1, num2; //variables to store the numbersString inputStr, outputStr; // strings to receive from the user// and displayinputStr=JOptionPane.showInputDialog("Enter the number: ");num1 = Long.parseLong(inputStr); // change the string tonum2 = num1; // numbersif (num1 <= 0){num1 = - num1; //if the numbers are negative, change the sign inputStr = inputStr.valueOf(num1);//change the inputStr value } if (isPalindrome(inputStr))outputStr = num2 + " is a palindrome";elseoutputStr = num2 + " is not a palindrome";JOptionPane.showMessageDialog(null,…arrow_forwardwe are going to create a new subclass of the SimpleGeometricObject class, namedTriangle. Copy the source code of the SimpleGeometricObject class from the following link: https://liveexample.pearsoncmg.com/html/SimpleGeometricObject.html TASK 1: Create a Triangle class that extends the SimpleGeometricObject class in Eclipse, followingthe below UML diagram. Use the following formula to calculate the area of a triangle: A = 1/2 × base × height TASK 2: Create a TestTriangle class in an individual .java file. In the main method,(1) Create a Triangle object with default base and height values.(2) Create a Triangle object with specified base = 3 and height =4. TASK 3: Add a toString() method to the Triangle class. In this toString() method,(1) Print the base, height, and area of a Triangle object.(2) Call the toString() method of the superclass using the super key word.Then, in the main method of the TestTriangle class, make the two Triangle objects that youcreated in Task 2…arrow_forwardI need help creating a Java code package in a pyramid with 3 sides (pyramid3) and pyramid with 4 sides (pyramid4) classes as described in the image below package objectsPackage; import interfacePackage.ShapesInterface; public class Pyramid3 implements ShapesInterface { @Override publicdouble getArea() { // TODO Auto-generated method stub return 0; } @Override publicdouble getVolume() { // TODO Auto-generated method stub return 0; } @Override publicvoid displayArea() { // TODO Auto-generated method stub } @Override publicvoid displayVolume() { // TODO Auto-generated method stub } }arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Programming Logic & Design ComprehensiveComputer ScienceISBN:9781337669405Author:FARRELLPublisher:CengageEBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENTSystems ArchitectureComputer ScienceISBN:9781305080195Author:Stephen D. BurdPublisher:Cengage Learning
- EBK JAVA PROGRAMMINGComputer ScienceISBN:9781305480537Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENTMicrosoft Visual C#Computer ScienceISBN:9781337102100Author:Joyce, Farrell.Publisher:Cengage Learning,
Programming Logic & Design Comprehensive
Computer Science
ISBN:9781337669405
Author:FARRELL
Publisher:Cengage
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Systems Architecture
Computer Science
ISBN:9781305080195
Author:Stephen D. Burd
Publisher:Cengage Learning
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781305480537
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Microsoft Visual C#
Computer Science
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Cengage Learning,
Time Complexity Analysis - How To Calculate Running Time | InterviewBit; Author: InterviewBit;https://www.youtube.com/watch?v=--oxG4Q1PA0;License: Standard YouTube License, CC-BY