Introduction to Java Programming and Data Structures, Comprehensive Version (11th Edition)
11th Edition
ISBN: 9780134670942
Author: Y. Daniel Liang
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Concept explainers
Question
Chapter 14.11, Problem 14.11.2CP
Program Plan Intro
Shapes:
There are many shape classes in JavaFX in order to draw shapes like circles, rectangles, arcs, texts, polygons, etc. It is an abstract class that describes some common properties like “fill”, “stroke”, and “strokeWidth” for all shapes.
- “fill” property – It is used to specify a color that has to be given inside the shape.
- “stroke” property – It is used to specify the outline color.
- “strokeWidth” property – It is used to specify the thickness of the stroke.
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
1. The main function creates 5 pixels with random red, green, and blue values. Complete the id_color function to return “red” if the red value is greater than the green and blue, “green” if the green value is greater than the red and blue, and “blue” if the blue value is greater than the red and green. If there is no clear maximum value (for example, if the red and green values are the same) return None. Do not change the main function.
import imageimport random
def id_color(p):'''Returns the dominant color of pixel p'''pass#Your code here to determine the dominant color and return a string identifying it#Hint: get the red, green & blue values and use an if statement to determine which has the highest value
def main():'''Controls the program'''for i in range(5): #Loop 5 timesr = random.randrange(0, 256)g = random.randrange(0, 256)b = random.randrange(0, 256)print(r, g, b) #Show the pixel red, green & blue valuesnew_pixel = image.Pixel(r, g, b)print(id_color(new_pixel))
main()…
Student Name
Student Id
1. Write a program to rotate frame wire teapot and decrease the rotation speed by coding the
right button of the mouse and display menu on middle button object.
Please do not give solution in image format thanku
Flappy Bird
We have a red dot flapping through a maze of “pipes” (green vertical lines). Press the button and the dot goes up, release the button and the dot goes down. You need to also keep track of the score, which will be a decimal value of up to at least 999, shown on the hex displays of the board.
The project will be done with Verilog and FPGA
Describe the project from a user standpoint: what it does, how the user will interact with it (be specific; think about what I/O they will use to move left or right), etc.
Include a top-level block diagram. This needs to be detailed enough that we can understand how the different blocks of the system interact, but does not have to be super complex.
Chapter 14 Solutions
Introduction to Java Programming and Data Structures, Comprehensive Version (11th Edition)
Ch. 14.2 - Explain the evolution of Java GUI technologies.Ch. 14.2 - Prob. 14.2.2CPCh. 14.3 - Prob. 14.3.1CPCh. 14.3 - Show the output of the following JavaFX program:...Ch. 14.4 - How do you create a Scene object? How do you set a...Ch. 14.4 - Prob. 14.4.2CPCh. 14.4 - Prob. 14.4.3CPCh. 14.4 - How do you replace the code in lines 20 and 21 in...Ch. 14.5 - Prob. 14.5.1CPCh. 14.5 - Prob. 14.5.2CP
Ch. 14.5 - Can you create an object of IntegerProperty using...Ch. 14.5 - Prob. 14.5.4CPCh. 14.6 - Prob. 14.6.1CPCh. 14.6 - Prob. 14.6.2CPCh. 14.7 - How do you create a color? What is wrong about...Ch. 14.7 - Prob. 14.7.2CPCh. 14.7 - Prob. 14.7.3CPCh. 14.8 - Prob. 14.8.1CPCh. 14.8 - Prob. 14.8.2CPCh. 14.9 - Prob. 14.9.1CPCh. 14.9 - Prob. 14.9.2CPCh. 14.9 - Prob. 14.9.3CPCh. 14.10 - Prob. 14.10.1CPCh. 14.10 - Prob. 14.10.2CPCh. 14.10 - Prob. 14.10.3CPCh. 14.10 - Prob. 14.10.4CPCh. 14.10 - Prob. 14.10.5CPCh. 14.11 - How do you display a text, line, rectangle,...Ch. 14.11 - Prob. 14.11.2CPCh. 14.11 - Prob. 14.11.3CPCh. 14.11 - Write code fragments to fill red color in a...Ch. 14.11 - Prob. 14.11.5CPCh. 14.11 - Prob. 14.11.6CPCh. 14.11 - Write code fragments to display the outline of the...Ch. 14.11 - Write code fragments to display the lower half of...Ch. 14.11 - Write code fragments to display a polygon...Ch. 14.11 - Write code fragments to display a polygon...Ch. 14.11 - Prob. 14.11.11CPCh. 14.12 - Prob. 14.12.1CPCh. 14 - Prob. 14.1PECh. 14 - Prob. 14.2PECh. 14 - (Display three cards) Write a program that...Ch. 14 - (Color and font) Write a program that displays...Ch. 14 - (Characters around circle) Write a program that...Ch. 14 - Prob. 14.6PECh. 14 - (Display random 0 or 1) Write a program that...Ch. 14 - (Create four fans) Write a program that places...Ch. 14 - (Display a cylinder) Write a program that draws a...Ch. 14 - Prob. 14.11PECh. 14 - (Display a bar chart) Write a program that uses a...Ch. 14 - Prob. 14.13PECh. 14 - (Display a rectanguloid) Write a program that...Ch. 14 - Prob. 14.15PECh. 14 - Prob. 14.16PECh. 14 - (Game: hangman) Write a program that displays a...Ch. 14 - Prob. 14.18PECh. 14 - (Plot the sine and cosine functions) Write a...Ch. 14 - (Draw an arrow line) Write a static method that...Ch. 14 - Prob. 14.21PECh. 14 - (Connect two circles) Write a program that draws...Ch. 14 - (Geometry: two rectangles) Write a program that...Ch. 14 - (Geometry: Inside a polygon?) Write a program that...Ch. 14 - Prob. 14.25PECh. 14 - Prob. 14.27PECh. 14 - (Random time) Modify the ClockPane class with...Ch. 14 - (Game: bean machine) Write a program that displays...
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
- The graphic functions commonly used 5 points to create and print text are described : outtextxy(string); True Falsearrow_forwardWrite the code to draw a rectangle centered at (70, 70) with a width of 100 and a height of 100. Fill the rectangle with the color red.arrow_forwardTo draw a horizontal line, you can use A. B. c. D. E. F.arrow_forward
- Code with comments and output screenshot is must and I will Upvote. Thank you!arrow_forwardPlease do not give solution in image format thanku Figurel: A solution for the sample input. The rectangular pieces cover the cake entirely, so there are no leftovers. This solution is described in the sample output. Input format: The first line contains p, q, and n, where pxq are the dimensions of the cake and n is the number of roses. Then n lines follow, the i-th line contains the coordinates of the i-th rose, where the first coordinate is between 1 and p and the second coordinate is between 1 and q. Output format: The output contains n+1 lines. The first n lines contain four numbers each: the j-th line contains aj, bj, cj, dj, where 1sajscjsp and 1sbjsdjsq and (aj,bj) and (cj,dj) correspond to the grid squares at the opposite corners of the rectangular piece for the j-th person. The rectangular pieces have to be non-overlapping. The last line contains a single number, the area of the leftovers. The area of the leftovers should be the smallest possible. Code constraints: 0< p, q,…arrow_forwardPython question please include all steps and screenshot of code. Also please provide a docstring, and comments throughout the code, and test the given examples below. Thanks. A single playing card can be represented by a string where the first character is a digit2-9 or a letter ‘A’, ‘T’, ‘J’, ‘Q’, or ‘K’, for Ace, Ten, Jack, Queen, King respectively, andthe second character is one of ‘S’, ‘H’, ‘D’, or ‘C’ for Spades, Hearts, Diamonds, orClubs. A hand of cards can be represented by a list of strings. Write a function calledthreeOfAKind() that takes a list of strings representing a hand of cards, and returns Trueif there are exactly three cards with the same value (regardless of suit), False otherwise.>>> threeOfAKind(['3D', 'KD', 'JD', '3H', '3S'])True>>> threeOfAKind(['3D', 'KD', 'JD', '3H', '4S', '5S'])False>>> threeOfAKind(['3D', '3H', '3S', '3C', 'AC'])Falsearrow_forward
- Write the code to draw an oval centered at (70, 70) with a width of 200 and a height of 100. Fill the rectangle with red.arrow_forwardadd a code at the "Search a book" where i can search for a book and if the word matches the book it will display "(Title of the book) - Book Available"and if the word doesnt match it will display "Book unavailable"codes should be displayed at line 93arrow_forwardWrite code to draw the following picture.arrow_forward
- 22- When adding numbers to the pages of the document, we use the path (insert- page numbers). correct Error 23- In order to convert the document in the form of consistent columns, we use the path (insert -columns). carrect Error 24- To insert a cover page for the file we use the path (insert cover page). correct Error 25- For the footer we need the path (Layout Page - Insert - Footer). correct Error 00arrow_forwardplot3(X,Y,Z,LineSpec) creates the plot using the specified line style, * .marker, and color True Falsearrow_forwardIf x=0:pi/100 : 2*pi; y sin(x) then how we can plot the curve with green color, solid style and square marker plot(x ,y, "g","-","s") plot(x,y,"g,-*") plot('x,y'g,-, s) )O plot(x,y g',""s') Oarrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Np Ms Office 365/Excel 2016 I NtermedComputer ScienceISBN:9781337508841Author:CareyPublisher:CengageNew Perspectives on HTML5, CSS3, and JavaScriptComputer ScienceISBN:9781305503922Author:Patrick M. CareyPublisher:Cengage Learning
Np Ms Office 365/Excel 2016 I Ntermed
Computer Science
ISBN:9781337508841
Author:Carey
Publisher:Cengage
New Perspectives on HTML5, CSS3, and JavaScript
Computer Science
ISBN:9781305503922
Author:Patrick M. Carey
Publisher:Cengage Learning