Make a simple calculator application with two main classes - 1. calculator  2. Login Form instructions are given be

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899604
Joined: Mon Aug 02, 2021 8:13 am

Make a simple calculator application with two main classes - 1. calculator  2. Login Form instructions are given be

Post by answerhappygod »

Make A Simple Calculator Application With Two Main Classes 1 Calculator Nbsp 2 Login Form Instructions Are Given Be 1
Make A Simple Calculator Application With Two Main Classes 1 Calculator Nbsp 2 Login Form Instructions Are Given Be 1 (58.85 KiB) Viewed 30 times
Make A Simple Calculator Application With Two Main Classes 1 Calculator Nbsp 2 Login Form Instructions Are Given Be 2
Make A Simple Calculator Application With Two Main Classes 1 Calculator Nbsp 2 Login Form Instructions Are Given Be 2 (63.99 KiB) Viewed 30 times
Make A Simple Calculator Application With Two Main Classes 1 Calculator Nbsp 2 Login Form Instructions Are Given Be 3
Make A Simple Calculator Application With Two Main Classes 1 Calculator Nbsp 2 Login Form Instructions Are Given Be 3 (64.05 KiB) Viewed 30 times
Make A Simple Calculator Application With Two Main Classes 1 Calculator Nbsp 2 Login Form Instructions Are Given Be 4
Make A Simple Calculator Application With Two Main Classes 1 Calculator Nbsp 2 Login Form Instructions Are Given Be 4 (34.95 KiB) Viewed 30 times
Make a simple calculator application with two main classes - 1. calculator  2. Login Form instructions are given below. Student Specification #1 Main class: calculator Make a simple calculator application. First number 3 Second number: 7 Operation: Result: 10 The user can input 2 numbers. The program can add, subtract, multiply or divide the two numbers and display the result. Step 4: Copy and paste the following code as a template for your Calculator class: public class Calculator extends Application { public static void main(String[] args) { launchCargs); } private Label firstNumber.bl; privale TextField firsLNumberTſ; private Label secondNumberlbl; private TextField second NumberTf; private label operation bl; private Button addBtn; private Button subBtn; private Button mulBt; private Button divBtn; private Label result2bl; private TextField resultTf; aOverride public void start(Stage stage) throws Exception { // 1. create the leaf nodes // 2. create the branch nade // 3. set the scene, show the stage } }
Step 6: Write some code to create the leaf nodes. Place this code aftcr // 1. Create the leaf rades Step 7: For the first version of this application, you will create the simpler screen layout shown below. To do this, create a veax branch node with 10 pixels of spacing and add all of the leaf nodes to it: First number: 3 Second number 2 Operation: + 7 Result Step 8: Set the scene and show the stage. Use your VBox as the root node of the scene. Run your program to see if the GUI looks as in the screenshot AT THIS POINT, compile your code to see if you're on the right track application, you only need to "get' the first two numbers Step 9: Define getters/setters for your text fields that convert between String and int. For and "set" the result: public class calculator extends Application public int getfirstNumber {...} public int getSecondber public void setiesult(int value) {...} 1 Step 10: Define the event handlers. c.g. addBtn.setOnAction...: for the 4 buttons. You need to learn all the different techniques, so: 1. Define an event handler for addBtn using an inner class named AddHandler. It should set the result to the first number + the second number. 2. Denne an event handler for subBtn using an anonymous inner class should set the result to the first number - the second number. 3. Define an event handler for mulBtn using a lambda expression. It should set the result to: the first number the second number. 4. Dcfincan event handler for divBtn using a lambda expression. It should set the result to: the first number / the second number. Test that your application works. Step 11: Finally, modify your GUI layout to use a GridPane as shown in the following screenshot: First number 3 Second number: -- Operation Result 10
Student Specification #2 Main class: Loginforme In the same project, create another class called LoginForn. This application should show the following scene on the primary stage with the stage title "Login": Username Password: Login If the user inputs username "sam" and password "mypassword" and then presses the Login button, you show the following message: Username: sam Password: .... Login Password correct! If the user inputs any other username or password and then presses the Login bullon, you show you show the following message: Username: paul Password : Login Password incorrect! Hint: The message is not a Label. Labels should only appear before form inputs/controls to label the value that the user inputs. The message is a Text Create it with resultTxt - new Text().Thc Text node starts off cmpty, showing no message. When you want to display a message, you call the setText method on the text. Hint: The loginForm class should also be created in the default package alongside your existing Calculator class. In NetBeans, you can run the Login Form Hint: The message is not a Label Labels should only appear before for inputs/controls to label the value that the user inputs. The message is a Text. Create it with resultTxt - new Texto. The Text node starts off empty, showing no message. When you want to display a message, you call the setText mcthad on the text. Hint: The login or class should also be created in the default package alongside your existing Calculator class. In NetBeans, you can run the Login Form class by right-clicking on it and selecting "Run File"
the following picture is the classes i need code for to create  simple calculator.(GUI) Discussion is set to read only Code Submission Challenge Submissions Calculator java 4. Login Form.java 1 jon before the submission. it your source code to ED o the corresponding file files to ED in one go. + Calculator.ava w File w Folder doad
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply