Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
expand_more
expand_more
format_list_bulleted
Concept explainers
Question
we are going to create a new subclass of the SimpleGeometricObject class, named
Triangle.
Triangle.
Create a Triangle class that extends the SimpleGeometricObject class in Eclipse, following
the below UML diagram. (seperate code)
the below UML diagram. (seperate code)
Use the following formula to calculate the area of a triangle:
A = 1/2 × base × height
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;
}
}
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by stepSolved in 2 steps with 2 images
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 an Empty Activity Project to implement the following Layouts. Layouts: one Text, one E-mail, one Image and one Button. Tips: - The project’s layout structure is ConstraintLayout. - The first element is Text. You must write your name in place of “XYZ” with a textSize = 20sp and textColor of Red. - The second element is E-mail. You must write your email address under your name, with the textColor = Blue. - The third element is an image. You can add any image after your name and email with any size you like. - The fourth element is a button. Place the button on the end of the page and call it ”OK”. Implement the previous requirements and include the XML file and screenshot of the layout’s output, after you run the application. Layout’s output:arrow_forwardDevelop the code that would be used in the main() function to test the class Cube. Create an object of Cube type using the constructor with argument, with the name of "Box", side length of 5, and color "Brown". Print out the information for the Cube. Change the name to BigBox, and increase the volume by 60%. Print the information for your Cube object one more time to verify the changes. Edit View Insert Format Tools 12pt ✓ Paragraph v Table BIU ✓ T² ✓arrow_forwardPlease see the snip for the detail. Note: The polygon have to rotate clockwise in same also counterclock wise have to rotate: here is my code it have issue it only rotate to clockwise but in same time have to rotate to the counterclockwise too but it not plesase fix it or write from new. my code: import turtle as t import math class CenteredPolygon: def __init__(self, n, size, center=(0, 0), pen=None, **kwargs): self.numsides = n self.size = size self.center = center self.corners = [] self.pen = pen if pen is not None else self.init_pen(**kwargs) self.draw() def init_pen(self, **kwargs): pen = t.Turtle() for key, value in kwargs.items(): try: f = getattr(pen, key) f(value) except Exception as e: print(e) return pen def set_corners(self) -> list: p = self.pen p.pu() p.goto(self.center) for i…arrow_forward
- The Add-Computer command has how many parameter sets? Within those parameters are there any that are positional? If there are positional parameters, please list them. Does this command run? Get-EventLog Application 0,1 -newest Why does it, or does it not?arrow_forwardI'm working on an assignment and i'm trying to create a to-do list in AndroidStudio. I've created the listview, edit text, switch and button, but I've hit a snag with the following: Create a new Java object to hold each todo item, it should contain a string with the text of the todo, and a boolean for if it is urgent or not. Create a List to hold all your items, and for the adapter to use for displaying them. When you click “Add”, you should create a new todo item and add it to the list, clear out the text in the EditText, and call “notifyDatasetChanged()” on your adapter so it refreshes. Implement a BaseAdapter to power the ListView. In AndroidStudio, type ctrl + O (the letter ‘O’, not number zero). From the list of inherited functions, implement these ones: int getCount() - This returns the number of rows that will be in your listView. In your case, it should be the number of strings in the array list object ( return list.size() ). Object getItem(int position) – This…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_forward
- What would be the missing codearrow_forwardIn Checkpoint A, the game will not yet be playable as a two-player game. It will be playable by you in a type of "solitaire mode." Implement these functions from the template following the description (specification) in their docstring: show_top_card() get_top_card() add_card_to_discard() check_racko() find_and_replace() play_hand() The main function to drive the game has been provided. Missing input/output statements are part of play_hand() and left for you to implement, guided by the sample input/output. None of the other functions left to implement use input or print. The case / capitalization of user input should be ignored. On any invalid user input, the program should exit with a non-zero exit code. Hint: Use Python Tutor. as much as possible when testing gameplay. Zybooks requires you specify all your inputs in advance and it is less enjoyable to play that way. Sample input/output 1 When the inputs are: no yes 1 yes 5 yes 7 The expected behavior is (inputs are shown in-line)…arrow_forwardThis is for the game brick breaker use Java to code what's posted down below.arrow_forward
- There 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_forwardClass definitions for DateTimerPicker and MonthCalender are provided below.arrow_forward1. How would you access the grid property of the parameters object? parameters.grid parameters/grid parameters(grid) 2. What will be displayed in the devtool console after the following is executed? var a = 200; var b = a--;console.log("b = " + b + " a = " + a); b = 199 a = 199 b = 200 a = 200 b = 200 a = 199 3. Some users have specific presentation needs based on personal or technological limitations or preferences. Separating content from presentation allows these users the option to control how they view content. True False 4. With CSS, you can specifically cater the style to each device to ensure an optimal experience. True False 5. Some users have specific presentation needs based on personal or technological limitations or preferences. Separating content from presentation allows these users the option to control how they view content. True False 6. With CSS, you can specifically cater the style to each device to ensure an…arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education