Application to calculate ticket prices

Assignment Help Basic Computer Science
Reference no: EM131548531

TicketsRUs needs an application to calculate ticket prices. There are three ticket prices:

  • Orchestra$85 each
  • Mezzanine$70 each
  • Balcony$45 each

There is also a 15% discount on matinee performances.

Your application has the GUI shown below.

With the following named components:

Component

Type

Purpose

txtNum

JTextField

Input for number of tickets

chkMatinee

JCheckBox

Check if matinee performance

radOrchestra

JRadioButton

Check for orchestra tickets

radMezzanine

JRadioButton

Check for mezzanine tickets

radBalcony

JRadioButton

Check for balcony tickets

btnCalc

JButton

Click to calculate price

txtEach

JTextField

Displays price of each ticket

txtTotal

JTextField

Displays total price

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.  

The action listener for btnCalc is set up as follows.

btnCalc.addActionListener(new ActionListener() {

        public void actionPerformed(ActionEvent e) {

                 calcPrice(); //write the code for this method

        }

});

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:

private void calcPrice()

Reference no: EM131548531

Questions Cloud

Three stocks is divided between dividends and capital gains : The expected pretax return on three stocks is divided between dividends and capital gains. Assume the expected dividend is a level perpetuity.
Which organisms showed sensitivity to oil toxicity : How does adding fertilizer (and therefore nitrogen) affect the metabolism of these organisms? Which organisms showed sensitivity to oil toxicity?
Two mutually exclusive projects of similar size : Which of the following investment criteria takes the time value of money into consideration? When will you be indifferent between two mutually exclusive project
Describe the major organizational types of physician groups : Include a title page, your name, instructor, course, date, and Learning Plan assignment [Learning Plan 9].
Application to calculate ticket prices : TicketsRUs needs an application to calculate ticket prices. There are three ticket prices:
What type of mental health agency would you start : P.S my mental health agency serves people with autoimmune diseases, my focusis Multiple Sclerosis, my services would offer resources to help combat.
Legal aspects of information technology : This week, you examined the legal aspects of information technology in regards to intellectual property, copyrights, and illegal software.
Develop communication strategies : Identify the target group for your research and provide an overview of their location in the workplace.
Information about first lego league : Please submit SQL statements as text file. You do not need to show screen shot. Make sure you have tested your SQL statements in Oracle.

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Identifies the cost of computer

identifies the cost of computer components to configure a computer system (including all peripheral devices where needed) for use in one of the following four situations:

  Input devices

Compare how the gestures data is generated and represented for interpretation in each of the following input devices. In your comparison, consider the data formats (radio waves, electrical signal, sound, etc.), device drivers, operating systems suppo..

  Cores on computer systems

Assignment : Cores on Computer Systems:  Differentiate between multiprocessor systems and many-core systems in terms of power efficiency, cost benefit analysis, instructions processing efficiency, and packaging form factors.

  Prepare an annual budget in an excel spreadsheet

Prepare working solutions in Excel that will manage the annual budget

  Write a research paper in relation to a software design

Research paper in relation to a Software Design related topic

  Describe the forest, domain, ou, and trust configuration

Describe the forest, domain, OU, and trust configuration for Bluesky. Include a chart or diagram of the current configuration. Currently Bluesky has a single domain and default OU structure.

  Construct a truth table for the boolean expression

Construct a truth table for the Boolean expressions ABC + A'B'C' ABC + AB'C' + A'B'C' A(BC' + B'C)

  Evaluate the cost of materials

Evaluate the cost of materials

  The marie simulator

Depending on how comfortable you are with using the MARIE simulator after reading

  What is the main advantage of using master pages

What is the main advantage of using master pages. Explain the purpose and advantage of using styles.

  Describe the three fundamental models of distributed systems

Explain the two approaches to packet delivery by the network layer in Distributed Systems. Describe the three fundamental models of Distributed Systems

  Distinguish between caching and buffering

Distinguish between caching and buffering The failure model defines the ways in which failure may occur in order to provide an understanding of the effects of failure. Give one type of failure with a brief description of the failure

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd