Java: An Introduction to Problem Solving and Programming (8th Edition)
8th Edition
ISBN: 9780134462035
Author: Walter Savitch
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Question
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.
- Override the “handle ()” method.
- Define the “main ()” method.
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents 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)
Ch. 9.1 - Prob. 1STQCh. 9.1 - What output would the code in the previous...Ch. 9.1 - Prob. 3STQCh. 9.1 - Prob. 4STQCh. 9.1 - Prob. 5STQCh. 9.1 - Prob. 6STQCh. 9.1 - Prob. 7STQCh. 9.1 - Prob. 8STQCh. 9.1 - In the code given in Self-Test Question 1,...Ch. 9.1 - In the code given in Self-Test Question 1,...
Ch. 9.1 - Prob. 11STQCh. 9.1 - Prob. 12STQCh. 9.1 - Prob. 13STQCh. 9.1 - Prob. 14STQCh. 9.2 - Prob. 15STQCh. 9.2 - Prob. 16STQCh. 9.2 - Prob. 17STQCh. 9.2 - Prob. 18STQCh. 9.2 - Prob. 19STQCh. 9.2 - Prob. 20STQCh. 9.2 - Suppose that, in Self-Test Question 19, we change...Ch. 9.2 - Prob. 22STQCh. 9.2 - Prob. 23STQCh. 9.3 - Prob. 24STQCh. 9.3 - Prob. 25STQCh. 9.3 - Prob. 26STQCh. 9.3 - Prob. 27STQCh. 9.3 - Prob. 28STQCh. 9.3 - Repeat Self-Test Question 27, but change the value...Ch. 9.3 - Prob. 30STQCh. 9.3 - Prob. 31STQCh. 9.3 - Prob. 32STQCh. 9.3 - Consider the following program: a. What output...Ch. 9.3 - Write an accessor method called getPrecision that...Ch. 9.3 - Prob. 35STQCh. 9.4 - Prob. 36STQCh. 9.4 - Prob. 37STQCh. 9.4 - Prob. 38STQCh. 9 - Write a program that allows students to schedule...Ch. 9 - Prob. 2ECh. 9 - Prob. 3ECh. 9 - Prob. 4ECh. 9 - Prob. 5ECh. 9 - Write code that reads a string from the keyboard...Ch. 9 - Create a class Rational that represents a rational...Ch. 9 - Prob. 9ECh. 9 - Suppose that you are going to create an object...Ch. 9 - Revise the class RoomCounter described in the...Ch. 9 - Prob. 12ECh. 9 - Write a class LapTimer that can be used to time...Ch. 9 - Prob. 1PCh. 9 - Prob. 2PCh. 9 - Prob. 3PCh. 9 - Write a program that uses the class calculator in...Ch. 9 - Prob. 3PPCh. 9 - Prob. 7PPCh. 9 - Suppose that you are in change of customer service...Ch. 9 - Write an application that implements a trip-time...
Knowledge Booster
Similar questions
- Object Oriented Programming javaarrow_forwardCreate a JavaFX application that implements a short survey. The first question should ask the user for his or her favourite color and present the choices “red”, “orange”, “blue”, and “green” in 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–100arrow_forwardCreate an application in Java that uses card layout with three cards. The first card - a login card - should have two text fields, one for username and other for password. There are two users - Bob and Fred - whose passwords are "mubby and "goolag" respectively. If Bob logs in, switch to a card - the bob card - that has a text field, a text area and two buttons. If the first button is pressed, get the text from the text field and append it to the text area. If the second button is pressed, return to the login card. If Fred logs in, switch to a card - the fred card - that has three buttons. If the first button is pressed, change the background color to green. If the second button is pressed, change the background color to red. If the third button is pressed, return to login card.arrow_forward
- Java guiarrow_forwardAnalyze the following JavaFX program and Next Student Perviou COmplete the missing code based on the comments. The Program should show window like this. public class EmployeeInterface extends Application{ @Override public void start(Stage stage) throws Exception { 1- // Create a boreder Pane object 2- |/ create HBox object 3- // create the two command button objects 4- // add command buttons in the HBOX object 5- // create grid pane object 6- // create the label and TextField for the name and add them in the first row in the grid pane 7- // create the label and TextField for the Major and add them in the first row in the grid pane 8- // Put the commands in the buttom of the BorderPane 9- // Put the GridPane which contain student information in the center of BorderPane 10- // create the Scene Object and it set it as stage scene and show the stage } }arrow_forwardComputer Science A Java swing program that lets the user draw a line that can be individually deleted or moved. make a JPanel to allow users to draw a line with their mouse, move the line to wherever, and delete each individual line chosen by the user. Use JRadioButton and/or JComboBox in a separate JPanel to allow users to choose to draw, move, or delete a line. The user should be able to have multiple lines at once Whenever necessary, the user should be prompted with instructions on how to continue or what is wrong. (For example; conformation prompt for deleting a line, or which line the user wants to delete)arrow_forward
- Write a JavaFX program to design a graphical user Interface for Women's Salon Reservation System. The Main Window Should have 5 Buttons Along with the LOGO named Beauty salon placed at the top of the window. The 5 buttons are: 1- Add booking 2- Update booking 3- Delete booking 4- Search booking 5- Services (You can write some services like: hair dry, nails care, skin care ....etc ). Here is some detailes about the buttons: Add Booking: The system will ask the user to enter the user information (Name, Phone number, Date Booked, service or anything related to your project. Once the Booking is added a message Booking confirmed with name and service, Date Booked will be displayed. * The System need to check if the same Phone number is available, then you can add service to the same user.* The System should check the availability of the time. Update Booking: Can update the booking date or service, etc.. for the user. Phone number is the primary key to check for user information. Delete…arrow_forwardShowCurrentTime.java an example program in Chapter, gives a program that displays the current time in GMT. Common old news shows would show clocks across many time zones, write a program that modifies ShowCurrent Time and will display the time in prominent business centers. London, Paris, New York was common. Write a program that displays the time in: Berlin, London, New York, Chicago, San Francisco, Tokyo and Hong Kong. ↓ HONG KONG ↓ LONDON L PARIS TOKYO MOSCOW 101 BERLIN DUBAI iStock Credit: Tetlana Muslyaka NEW YORKarrow_forwardWrite JavaFX a program that allows a user to move |Move a rectangle a rectangle using mouse. The program should display a rectangle and allow a user to point the mouse inside the rectangle and drag the rectangle wherever the mouse goes. So the mouse point becomes the center of the rectangle.arrow_forward
- Prepare the user interface elements for a coffee vending machine with following features: Assume a machine for coffee and a cup of coffee costs 2 quarters. The machine accepts only quarters (if another type of coin is inserted it is returned to customer mechanically and no message is given, so ignore that case). The machine works in a way that the customer first needs to insert quarters. The vending machine memorizes the number of quarters inserted and displays the amount. The customer needs to press a button representing coffee. The machine never runs out of coffee. If right amount is inserted, the machine gives the customer coffee. With a message specifying that coffee is ready. If the amount inserted into the machine is greater than the cost of coffee the machine returns the change. The machine also has a button for returning the money inserted which can be pressed any time. If the customer presses the coffee button and there’s not enough money inserted, system requests for money.arrow_forwardVB create this program on visual basics or any other programming GUI langauge Create one object – Person, and code it. Create the menus shown in the demo program. The interface is a bit different from what you have done to this point. Play with the program to see how it works. The hungarian notation for a date control is dte. Commands The key commands of this program are: Add a Person Remove a Person Display next person Display previous person Display first person Display last person. Create the programming to make these components work. Refer to the power point notes for examples of how the code needs to be set up. Protecting Data against Accidental change Change the display to allow the user to enter data into text boxes, but protect the data from being accidentally changed by setting the ReadOnly property of the text boxes appropriately. This should be a sub. Call it as you need it. The Date has no ReadOnly property, use the Enabled property instead for this control. Use the enabled…arrow_forwardCellular Automata • A life simulation (cellular automata) can simulate the life of several existing ćells. For every two exişting old cells, one new cell will appear. So if there are 11 living cells at one time, then in the next generation there will be 16 cells. And in the third generation, there will be 24 cells alive. • If there are 5 initial cells at a time, how many cells are alive in the fifth generation? Create flowchart with input-output for various cases 10/27/2021 Prolog 05- Pattern Recognition & Loop 19arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- EBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENTEBK JAVA PROGRAMMINGComputer ScienceISBN:9781305480537Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENTMicrosoft Visual C#Computer ScienceISBN:9781337102100Author:Joyce, Farrell.Publisher:Cengage Learning,
- Programming Logic & Design ComprehensiveComputer ScienceISBN:9781337669405Author:FARRELLPublisher:Cengage
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781305480537
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Microsoft Visual C#
Computer Science
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Cengage Learning,
Programming Logic & Design Comprehensive
Computer Science
ISBN:9781337669405
Author:FARRELL
Publisher:Cengage