akosiraff

Download TicketsRUs C# Answer

Aug 27th, 2017
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.55 KB | None | 0 0
  1.  
  2. Download: https://solutionzip.com/downloads/ticketsrus/
  3. TicketsRUs needs an application to calculate ticket prices. There are three ticket prices:
  4. • Orchestra $90 each
  5. • Mezzanine $75 each
  6. • Balcony $50 each
  7. There is also a 20% discount on matinee performances .
  8. Your application has the GUI shown below.
  9. With the following named components:
  10. Component Type Purpose
  11. txtNum JTextField Input for number of tickets
  12. chkMatinee JCheckBox Check if matinee performance
  13. radOrchestra JRadioButton Check for orchestra tickets
  14. radMezzanine JRadioButton Check for mezzanine tickets
  15. radBalcony JRadioButton Check for balcony tickets
  16. btnCalc JButton Click to calculate price
  17. txtEach JTextField Displays price of each ticket
  18. txtTotal JTextField Displays total price
  19. Clicking the CalcPrice button should determine the price per ticket and the total price based on the user’s input and display in txtEach and txtTotal. You should make sure the number of tickets is entered and a ticket type is selected, otherwise give an error message.
  20. The action listener for btnCalc is set up as follows.
  21. btnCalc.addActionListener(new ActionListener() {
  22. public void actionPerformed(ActionEvent e) {
  23. calcPrice(); //write the code for this method
  24. }
  25. });
  26. Write the calcPrice method that is called by the action listener. This class method has access to all of the GUI components. You DO NOT HAVE TO CODE THE GUI. ONLY write the code for this method which does all the work. The header for the method is:
  27. private void calcPrice()
  28.  
  29. Download: https://solutionzip.com/downloads/ticketsrus/
Add Comment
Please, Sign In to add comment