Java: An Introduction to Problem Solving and Programming (8th Edition)
Java: An Introduction to Problem Solving and Programming (8th Edition)
8th Edition
ISBN: 9780134462035
Author: Walter Savitch
Publisher: PEARSON
Question
Book Icon
Chapter 9, Problem 7PP
Program Plan Intro

Short survey

Program plan:

  • Import required packages.
  • Define the main class “SurveyForm”.
    • Define the “main ()” method.
      • Launch the application.
    • Override the “start ()” method.
      • Create an object for “VBox” container.
      • Add a label to the container.
      • Create an object for “ToggleGroup”.
      • Create three radio buttons for the colors “Red”, “Orange”, “Blue”, and “Green” and these buttons to the toggle group.
      • Add all the radio buttons to the container.
      • Get the age from the user using “Spinner”
      • Set the value and add the spinner to the container.
      • Get the favorite programming language by using a “ChoiceBox” and add it to the container.
      • Create an action event for clicking the “submitBtn”.
        • Override the “handle ()” method.
          • Declare a variable “color”.
          • Check if “redRB” is selected.
            • Assign the color “red” to the variable “color.”
          • Check if “greenRB” is selected.
            • Assign the color “green” to the variable “color.”
          • Check if “orangeRB” is selected.
            • Assign the color “orange” to the variable “color.”
          • Check if “blueRB” is selected.
            • Assign the color “blue” to the variable “color.”
        • Print the color, age and programming language on the screen.
              • Add the submit button to the container.
              • Create a scene and place it on the stage.
              • Set the title.
              • Display the stage.

Blurred answer
Students have asked these similar questions
JavaProblem 2-5 Code ProblemProblem 2-5. Code Problem. Build an application with a text field and two buttons. Type a word or words in the text field. Click one of the buttons. Subtract one from the Unicode value for each character in the typed word(s), then redisplay it. This is a simple encoding technique. When you click the other button, reverse the process to decode the word.
Create a JavaFX application that implements a short survey. The first question should ask the user for his or her favorite colorand present the choices "red", "orange", and "green" in a radio buttons.The second question should ask the user for his or her age and present the choice in a spinner with the range 10-100. Third and finalquestion should ask the user to select his or her favorite programming language from the choices "Java","C++","Python", and C# presented in a choiceboxAdd a button, that when clicked , summarizess the user's selections.
In C#. Please make an interface that looks as descibes on the image

Chapter 9 Solutions

Java: An Introduction to Problem Solving and Programming (8th Edition)

Knowledge Booster
Background pattern image
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Text book image
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781305480537
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Text book image
Microsoft Visual C#
Computer Science
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Cengage Learning,
Text book image
Programming Logic & Design Comprehensive
Computer Science
ISBN:9781337669405
Author:FARRELL
Publisher:Cengage