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
Using the module graphics.py to draw a triangle requires the use of which of the following classes?
OTrigon
OPolygon
OTriangle
Oshape
OBJECT ORIENTED IN JAVA. I am genuienly asking for you to read this. it needs to contain inheritance.
Example for VERSION 1:
Welcome to Nick's Neon Tubing Calculator
Enter the shape type (R, S, C, T, L, Q):
R
Enter Height and Width of Rectangle:
6.5 12
The perimeter of a 6.5 x 12 rectangle is 37.0
Enter the shape type (R, S, C, T, L, Q):
C
Enter Diameter:
12
The circumference of circle with diameter 12 is 37.7
Enter the shape type (R, S, C, T, L, Q):
Q
Shapes Needed
37.0 - rectangle, 6.5 x 12
37.7 - circle, diameter 12 ---------------------------
74.7 Total Length
Thank You
there is a version 2 as well, if you look at the pictures. Every person I have asked to help has either not made it object oriented or that code did not work. PLEASE help.
This project utilizes three new classes:
· Word - an immutable class representing a word
· Words - a class representing a list of Word objects
· WordTester - a class used to test the Word and Words classes.
WordTester (the application) is complete and only requires uncommenting to test the Word and Words classes as they are completed. The needed imports, class headings, method headings, and block comments are provided for the remaining classes. Javadocs are also provided for the Word and Words classes.
Word
The Word class represents a single word. It is immutable. You have been provided a skeleton for this class. Complete the Word class using the block comments, Javadocs, and the following instructions.
1. Add a String instance variable named word which will contain the word.
2. Complete the one parameter constructor to initialize the word instance variable.
3. Complete the getLength method to return the number of characters in the…
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
- Create a class called complex containing real and imaginary parts and then use it to check whether two objects are of the same type, whether their attributes are same and whether they are pointing to the same object in pythonarrow_forwardRefer to the following interface: Provide two examples (screenshots) that in many ways could improve the above or similar interface using the principles of direct manipulation. Explain the relevant improvements as well. (Examples might have different object, labels and organization)arrow_forwardPlease do not give solution in image format thanku There are three folders of images with size 128 x 128 to use for test,train,and validation. There are subfolders called goodChair and damagedChair. Create a python image recognition program that will predict a good and damaged chair. Please create a program that creates a model with two subclass from the images. Then, use the model to predict images in the test folders with prediction of whether the images are good or damaged chairs. Print out the predictions in the folder with the label of good or bad chair, and the accuracy of the image. Requirement of python program: -code for model -code that uses model for image classification to predict the images -code that prints prediction of images and percentage of accuracyarrow_forward
- Write a class for the following object. Fraction - an object that represents parts of a whole number. A fraction is created by supplying a numerator and a denominator. Instance related actions 1. add - mutates this fraction by adding the other fraction value 2. subtract - mutates this fraction by subtracting the other fraction value 3. multiply - mutates this fraction by multiplying with the other fraction value 4. divide - mutates this fraction by dividing by the other fraction value 5. tostring - represents the fraction in a form of 'numerator/denominator" 6. compareTo - returns the following values 1. O when this fraction is equal with the other fraction 2. 1 when this fraction is greater than the other fraction 3. -1 when this fraction is less than the other fraction Example fraction1 = 1/2 fraction2 = 3/4 When fraction1.add(fraction2] is called, it will make the value of fraction 1 as 5/4. When fraction1.subtract(fraction2) is called, it will make the value of fraction 1 as -1/4.…arrow_forwardCreate the class Suitcase. Suitcase has things and a maximum weight limit, which defines the greatest total allowed weight of the things contained within the Suitcase object. Add the following methods to your class: A constructor, which is given a maximum weight limit public void addThing(Thing thing), which adds the thing in the parameter to your suitcase. The method does not return any value. public String toString(), which returns a string in the form "x things (y kg)" The things are saved into an ArrayList object: ArrayList<Thing> things = new ArrayList<Thing>(); The class Suitcase has to make sure the thing's weight does not cause the total weight to exceed the maximum weight limit. The method addThing should not add a new thing if the total weight happens to exceed the maximum weight limit. Below, you find an example of how the class can be used: public class Main { public static void main(String[] args) { Thing book = new Thing("Happiness…arrow_forwardAnswer guys. Need correct answer otherwise downvote.arrow_forward
- Classes – Write a class to represent a AlternativeEnergyCar. Select the fields and methods that fit the modeling of an alternative energy car. Make sure to include code for the constructors, set/get methods, a toString() method.arrow_forwardCreate a python program for the following details: Create an abstract class Shape Under Shape create abstract methods name, sides, and color. Create subclasses of Shape with the name Square, Pentagon, and Triangle. Under each subclass, implement the methods name, sides, and color with the following details. Square: print "Square", "I have 4 sides", "My color is yellow" Pentagon: print "Pentagon", "I have 5 sides", "My color is blue" Triangle: print "Triangle", "I have 3 sides", "My color is red" Create an instance of each subclasses. Ask the user for an input. (Assume the user will input 3, 4, or 5 only) if the user input 3 - print the details of an object of subclass Triangle if the user input 4 - print the details of an object of subclass Square if the user input 5 - print the details of an object of subclass Pentagon SAMPLE INPUT 1. num SAMPLE OUTPUT NEEDED: Enter a number: 3 Triangle I have 3 sides My color is redarrow_forwardModify the Date class below by adding a new method called nextDay() that increments the Date by 1 when called and returns a new Date object. This method should properly increment the Date across Month boundary (i.e from the last day of the month to the first day of the next month). //Date class declaration public class Date { private int month; // 1-12 private int day; // 1-31 based on month private int year; // any year private static final int [] daysPerMonth = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; //constructor: confirm proper value for month and day given the year public Date (int month, int day, int year) { //check if month in range if (month <=0 II month > 12) { throw new IllegalArgumentException( “month (“ + month + “) must be 1-12”); } //check if day in range for month if…arrow_forward
- Modify the Date class below by adding a new method called nextDay() that increments the Date by 1 when called and returns a new Date object. This method should properly increment the Date across Month boundary (i.e from the last day of the month to the first day of the next month). //Date class declaration public class Date { private int month; // 1-12 private int day; // 1-31 based on month private int year; // any year private static final int [] daysPerMonth = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; //constructor: confirm proper value for month and day given the year public Date (int month, int day, int year) { //check if month in range if (month <=0 II month > 12) { throw new IllegalArgumentException( “month (“ + month + “) must be 1-12”); } //check if day in range for month if…arrow_forwardThe class "Animal" has the following attributes: name, category, lifespan.Write a Python constructor method for the "Animal" class that takes values as parameters for all these attributes.Write only the constructor method, nothing else! pls use pyhton and answer fast thank u=)arrow_forwardFor this assignment, create a child class of car that creates a car of a randomly generated color. Using the existing car classes, add code to add 20 colored cars to the existing pane in 20 visible, random locations. You will end up with 4 classes: CarViewer.java CarComponent.java Car.java (unchanged from Chapter 3) ColorCar.java (extends Car)arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- EBK JAVA PROGRAMMINGComputer ScienceISBN:9781305480537Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENTEBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENT
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781305480537
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Time Complexity Analysis - How To Calculate Running Time | InterviewBit; Author: InterviewBit;https://www.youtube.com/watch?v=--oxG4Q1PA0;License: Standard YouTube License, CC-BY