Introduction to Java Programming and Data Structures, Comprehensive Version (11th Edition)
Introduction to Java Programming and Data Structures, Comprehensive Version (11th Edition)
11th Edition
ISBN: 9780134670942
Author: Y. Daniel Liang
Publisher: PEARSON
bartleby

Concept explainers

bartleby

Videos

Question
Book Icon
Chapter 14, Problem 14.6PE
Program Plan Intro

Game: display a checkerboard

Program Plan:

  • Import required packages.
  • Declare a main class named “Test” which extends the “Application” class.
    • Declare a “start ()” method which overrides the “start ()” method in the “Application” class. Inside this method,
      • Assign width as “200” to the variable “WIDTH_VALUE” and height as “200” to the variable “HEIGHT_VALUE”.
      • Create a Pane.
      • Loop 8 times using “for” loop.
        • If “i%2” equals “0”, then assign that value to the Boolean variable “is_White”.
        • Loop 8 times using “for” loop.
          • Create a rectangle object.
          • Set the stroke color as “BLACK”.
          • Check if the Boolean variable value is true.
            • Fill the box with white color.
          • Else,
            • Fill the box with black color.
          • Now assign false to the Boolean variable.
          • Add the rectangle object to the pane.
      • Create a scene and place it on the stage.
      • Set the title as “Exercise14_06”.
      • Display the stage on the window using “primaryStage.show ()” method.
    • Declare a main method using “public static main”.
      • Launch the method using “launch ()” method.

Blurred answer
Students have asked these similar questions
(Random Walk Robot) A robot is initially located at position (0, 0) in a grid [−5, 5] × [−5, 5]. The robot can move randomly in any of the directions: up, down, left, right. The robot can only move one step at a time. For each move, print the direction of the move in and the current position of the robot. Use formatted output to print the direction (Down, Up, Left or Right) in the left. The direction takes 10 characters in total and fill in the field with empty spaces. The statement to print results in such format is given below: cout << setw(10) << left << ‘Down’ << ... ; cout << setw(10) << left << ‘Up’ << ...; If the robot moves back to the original place (0,0), print “Back to the origin!” to the console and stop the program. If it reaches the boundary of the grid, print “Hit the boundary!” to the console and stop the program. A successful run of your code may look like: Due to randomness, your results may have a different trajectory…
(Random Walk Robot) A robot is initially located at position (0, 0) in a grid [−5, 5] × [−5, 5]. The robot can move randomly in any of the directions: up, down, left, right. The robot can only move one step at a time. For each move, print the direction of the move in and the current position of the robot. Use formatted output to print the direction (Down, Up, Left or Right) in the left. The direction takes 10 characters in total and fill in the field with empty spaces. The statement to print results in such format is given below: cout << setw(10) << left << ‘Down’ << ... ; cout << setw(10) << left << ‘Up’ << ...; If the robot moves back to the original place (0,0), print “Back to the origin!” to the console and stop the program. If it reaches the boundary of the grid, print “Hit the boundary!” to the console and stop the program. A successful run of your code may look like: Due to  randomness, your results may have a different…
(Written in Java or Python) Write a program that allows a user to select 3 points on a graphics panel. Then, draw a triangle using these 3 points. Allow the user to specify a number of random points to be generated inside of the triangle. For each random point that is within the boundaries of the triangle draw a small dot at each of the points that are halfway between the randomly generated point and each vertex of the triangle. Do not draw the randomly generated point. Allow the user to repeat the process without removing the old dots. Allow the user to clear the screen.

Chapter 14 Solutions

Introduction to Java Programming and Data Structures, Comprehensive Version (11th Edition)

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
Background pattern image
Computer Science
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
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Text book image
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Text book image
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
Text book image
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Text book image
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Text book image
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education
Literals in Java Programming; Author: Sudhakar Atchala;https://www.youtube.com/watch?v=PuEU4S4B7JQ;License: Standard YouTube License, CC-BY
Type of literals in Python | Python Tutorial -6; Author: Lovejot Bhardwaj;https://www.youtube.com/watch?v=bwer3E9hj8Q;License: Standard Youtube License