Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please help me to do this program using java netbeans please screenshot the output thankyou! JAVA GUIAND OOP Overview: Java Swing is a lightweight Graphical

image text in transcribed

image text in transcribed

image text in transcribed

Please help me to do this program using java netbeans please screenshot the output thankyou!

JAVA GUIAND OOP Overview: Java Swing is a lightweight Graphical User Interface (GUI) toolkit that includes a rich set of widgets. It includes package lets you make GUI components for your Java applications, and it is platform independent. In this activity, students will have an opportunity to design a GUI of a simple java program. Instruction: Create a program that would compute for the total amount of purchase based on user preferences. Design the user interface and the source code using object-oriented programming Requirements Design the user interface of the Pizza Ordering System. Sample interface design shown below (Design your own interface but use the same tools for every section). Pizza Ordering System Date July 05.2019 Customer Available Pizza Pasta Mountain Pizza Personal Regular Family Supreme Spaghetti w/ Meatballs Special Pansit Bihon Meat Lovers o o Veggie Lovers Hawaiian Pansit Palabok Sotanghon 0 Bacon Lovers Drinks Glass/Mug Pitcher Crust type Thick Additional Cheese Beef Bacon O Drum Governor Pack Road, Baguio City Contact Number: 442-3316 O Thin Details Compute Total Amount Amount Due: $643.50 Discount: $0.00 Tax (22%): S181.50 Close Application Pragdated by: Dion Tandingan a Total Amount: $825.00 Compute the total amount that the customer will pay based on the following Price List: Regular P 550 P 500 Pizza Supreme Meat Lovers Veggie Lovers Hawaiian Bacon Lovers Personal P 350 P 300 P 250 P 275 P 275 Family P 1,000 P 850 P 600 P750 P800 P 450 P 400 P 400 If the customer orders Family Supreme pizza, the pizza would cost P1,000.00. If the customer orders another pizza, let say Regular Hawaiian pizza, add P400 to the cost. The total amount would be P1,400.00. Also, include in the total amount the additional orders (see table below) the customer might avail. Additional Order: Food Spaghetti with Meat ball P 95 Special Pansit Bihon P 50 Pansit Palabok P 75 Sotanghon P 60 Soft drinks in: Glass/Mug P 25 Picher P 65 Dum P 120 Additional: Cheese P100.00 Beef 250.00 Bacon 200.00 In the details area, compute for the amount due which is 78% of the computed total amount, and the Tax which is 22% of computed the total amount. Source code must be in OOP style. Create classes of each type of pizza. In each class, encapsulate the prize by creating a private attribute. Use setter and getter method to pass the prize value to main class which is your interface (JFrame). You may use a simple conditional statement for additional orders and no need for a separate class. A practice activity is given as your guide. PRACTICE ACTIVITY: 1. Create a project Pizza and add a JFrame form. 2. Create a sub class of Pizza named Supreme. 3. Add a radiobutton, label and a button By default the names of the tools are as follows JRadioButton1 , JLabell and JButton1 4. Add the following code to Supreme class (Let's say prize = 280) package pizza; public class Supreme Pizza extends PizzaJFrame { private int prize; public void set Prize () { this.prize= 280; } public int getPrize () { return prize; } 5. Go to your JFrame Form and double click JButtonl and add following code 85 86 87 88 89 90 91 92 93 private void jButton1ActionPerformed (java.awt.event.ActionEvent evt) { if (RadioButton1.isSelected()) { Supreme Pizza pl = new Supreme Pizza(); pl.setPrize(); jLabell.setText (Integer.toString(pl.getPrize())); }else{ JOptionPane. showMessageDialog(this, "Other Pizza Type"); } Note: The codes shaded in gray is automatically added by netbeans. NO NEED TO ADD ANOTHER ONE. Just add the if block. 6. Test the program. Click the button while the radio button is unchecked. A message box will appear. Test it again this time check radio button and click the button. The labell must display 280. Analyze the code and use it in your activity. Good luck JAVA GUIAND OOP Overview: Java Swing is a lightweight Graphical User Interface (GUI) toolkit that includes a rich set of widgets. It includes package lets you make GUI components for your Java applications, and it is platform independent. In this activity, students will have an opportunity to design a GUI of a simple java program. Instruction: Create a program that would compute for the total amount of purchase based on user preferences. Design the user interface and the source code using object-oriented programming Requirements Design the user interface of the Pizza Ordering System. Sample interface design shown below (Design your own interface but use the same tools for every section). Pizza Ordering System Date July 05.2019 Customer Available Pizza Pasta Mountain Pizza Personal Regular Family Supreme Spaghetti w/ Meatballs Special Pansit Bihon Meat Lovers o o Veggie Lovers Hawaiian Pansit Palabok Sotanghon 0 Bacon Lovers Drinks Glass/Mug Pitcher Crust type Thick Additional Cheese Beef Bacon O Drum Governor Pack Road, Baguio City Contact Number: 442-3316 O Thin Details Compute Total Amount Amount Due: $643.50 Discount: $0.00 Tax (22%): S181.50 Close Application Pragdated by: Dion Tandingan a Total Amount: $825.00 Compute the total amount that the customer will pay based on the following Price List: Regular P 550 P 500 Pizza Supreme Meat Lovers Veggie Lovers Hawaiian Bacon Lovers Personal P 350 P 300 P 250 P 275 P 275 Family P 1,000 P 850 P 600 P750 P800 P 450 P 400 P 400 If the customer orders Family Supreme pizza, the pizza would cost P1,000.00. If the customer orders another pizza, let say Regular Hawaiian pizza, add P400 to the cost. The total amount would be P1,400.00. Also, include in the total amount the additional orders (see table below) the customer might avail. Additional Order: Food Spaghetti with Meat ball P 95 Special Pansit Bihon P 50 Pansit Palabok P 75 Sotanghon P 60 Soft drinks in: Glass/Mug P 25 Picher P 65 Dum P 120 Additional: Cheese P100.00 Beef 250.00 Bacon 200.00 In the details area, compute for the amount due which is 78% of the computed total amount, and the Tax which is 22% of computed the total amount. Source code must be in OOP style. Create classes of each type of pizza. In each class, encapsulate the prize by creating a private attribute. Use setter and getter method to pass the prize value to main class which is your interface (JFrame). You may use a simple conditional statement for additional orders and no need for a separate class. A practice activity is given as your guide. PRACTICE ACTIVITY: 1. Create a project Pizza and add a JFrame form. 2. Create a sub class of Pizza named Supreme. 3. Add a radiobutton, label and a button By default the names of the tools are as follows JRadioButton1 , JLabell and JButton1 4. Add the following code to Supreme class (Let's say prize = 280) package pizza; public class Supreme Pizza extends PizzaJFrame { private int prize; public void set Prize () { this.prize= 280; } public int getPrize () { return prize; } 5. Go to your JFrame Form and double click JButtonl and add following code 85 86 87 88 89 90 91 92 93 private void jButton1ActionPerformed (java.awt.event.ActionEvent evt) { if (RadioButton1.isSelected()) { Supreme Pizza pl = new Supreme Pizza(); pl.setPrize(); jLabell.setText (Integer.toString(pl.getPrize())); }else{ JOptionPane. showMessageDialog(this, "Other Pizza Type"); } Note: The codes shaded in gray is automatically added by netbeans. NO NEED TO ADD ANOTHER ONE. Just add the if block. 6. Test the program. Click the button while the radio button is unchecked. A message box will appear. Test it again this time check radio button and click the button. The labell must display 280. Analyze the code and use it in your activity. Good luck

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Systems For Advanced Applications 17th International Conference Dasfaa 2012 Busan South Korea April 2012 Proceedings Part 1 Lncs 7238

Authors: Sang-goo Lee ,Zhiyong Peng ,Xiaofang Zhou ,Yang-Sae Moon ,Rainer Unland ,Jaesoo Yoo

2012 Edition

364229037X, 978-3642290374

More Books

Students also viewed these Databases questions