Answered Essay: This is java question the class should be called theaterrevenue.java theater revenue a movie … Your question ha

This is java question the class should be called theaterrevenue.java theater revenue a movie … Your question has been answered Let us know if you got a helpful answer. Rate this answer Question: This is Java Question The class should be called TheaterRevenue.java Theater Revenue A movie thea… This is Java Question The class should be called TheaterRevenue.java Theater Revenue A movie theater only keeps a percentage of the revenue earned from ticket sales. The remainder goes to the movie company. Create a GUI application that allows the user to enter the following data into text fields: Price per adult ticket Number of adult tickets sold Price per child ticket Number of child tickets sold The application should calculate and display the following data for one night’s box office business at a theater: Gross revenue for adult tickets sold. This is the amount of money taken in for all adult tickets sold. Net revenue for adult tickets sold. This is the amount of money from adult ticket sales left over after the payment to the movie company has been deducted. Gross revenue for child tickets sold. This is the amount of money taken in for all child tickets sold. Net revenue for child tickets sold. This is the amount of money from child ticket sales left over after the payment to the movie company has been deducted. Total gross revenue. This is the sum of gross revenue for adult and child tickets sold. Total net revenue. This is the sum of net revenue for adult and child tickets sold. Assume the theater keeps 20 percent of its box office receipts. Use a constant in your code to represent this percentage. ??///

I have this code but is not Compile somebody tried to help but when I tried is not working

import javax.swing.*; import java.awt.*;

import java.awt.event.*;

public class GUIRevenueTheater extends JFrame {

final double percentage = .20;

double adultprice;

private JTextField k1;

private JTextField k2;

private JTextField k3;

private JTextField k4;

private JButton butt;

private final int guiwidthi = 400;

private final int guiheight = 200;

public GUIRevenueTheater() {

setTitle(“Theater Revenue”);

setSize(guiwidthi, guiheight);

setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

setLayout(new GridLayout(5,2));

butt = new JButton(“Calculation Revenue process”);

butt.addActionListener(new revenuecalc());

JLabel 111 = new JLabel(“price per adult ticket:”);

k1 = new JTextField(10);

JLabel 112 = new JLabel(“Numb of adult person tickets sold:”);

k2 = new JTextField(10);

JLabel 113 = new JLabel(“cost per child ticket:”);

k3 = new JTextField(10);

JLabel 114 = JLabel(“Numb of child person tickets sold:”);

k4 = new JTextField(10);

JPanel p1 = new JPanel();

JPanel p2 = new JPanel();

JPanel p3 = new JPanel();

JPanel p4 = new JPanel();

JPanel p5 = new JPanel();

JPanel p6 = new JPanel();

JPanel p7 = new JPanel();

JPanel p8 = new JPanel();

JPanel p9 = new JPanel();

p1.add(111); p2.add(k1);

p3.add(112); p4.add(k2);

p5.add(113); p6.add(k3);

p7.add(114); p8.add(k4);

p9.add(butt); add(p1);

add(p2); add(p3);

add(p4); add(p5);

add(p6); add(p7);

add(p8); add(p9);

setVisible(true); }

private class revenuecalc implements ActionListener

{

public void actionPerformed(ActionEvent e) {

String priceticketadultperson;

String soldpro; String priceticketchild;

String soldc;

priceticketadultperson = k1.getText();

adultprice=Double.parseDouble(priceticketadultperson);

System.out.print(“answer”);

soldpro = k2.getText();

double grossA1 = (adultprice)* double.parseDouble(soldpro);

double netAvalue = (grossA1) * percentage;

priceticketchild = k3.getText();

soldc = k4.getText();

double grossC1 = Double.parseDouble (priceticketchild)* Double.parseDouble(soldc);

double netCvalue = grossC1 * percentage; double totalGrossvalue = grossC1 + grossA1;

double totalNetvalue = netAvalue + netCvalue;

JOptionPane.showMessageDialog(null, “Total gross adult revenue values: ” +

grossA1 + “n” + “Total net value: + netAvalue + “n” + “Total gross child person value: ” +

grossC1 + “n” + “Total netchild value: ” + netCvalue + “n” + “Total gross sales: ” +

totalGrossvalue + “n” + Total net sales: ” + totalNetvalue);

}

}

}

This again is not compile help me Itried my self I got very hard time

Expert Answer

Hi

I have fixed the issue and now it is error free.

GUIRevenueTheater.java

import java.awt.GridLayout;

import java.awt.event.ActionEvent;

import java.awt.event.ActionListener;

import javax.swing.JButton;

import javax.swing.JFrame;

import javax.swing.JLabel;

import javax.swing.JOptionPane;

import javax.swing.JPanel;

import javax.swing.JTextField;

public class GUIRevenueTheater extends JFrame {

final double percentage = .20;

double adultprice;

private JTextField k1;

private JTextField k2;

private JTextField k3;

private JTextField k4;

private JButton butt;

private final int guiwidthi = 400;

private final int guiheight = 200;

public GUIRevenueTheater() {

setTitle(“Theater Revenue”);

setSize(guiwidthi, guiheight);

setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

setLayout(new GridLayout(5,2));

butt = new JButton(“Calculation Revenue process”);

butt.addActionListener(new revenuecalc());

JLabel l11 = new JLabel(“price per adult ticket:”);

k1 = new JTextField(10);

JLabel l12 = new JLabel(“Numb of adult person tickets sold:”);

k2 = new JTextField(10);

JLabel l13 = new JLabel(“cost per child ticket:”);

k3 = new JTextField(10);

JLabel l14 = new JLabel(“Numb of child person tickets sold:”);

k4 = new JTextField(10);

JPanel p1 = new JPanel();

JPanel p2 = new JPanel();

JPanel p3 = new JPanel();

JPanel p4 = new JPanel();

JPanel p5 = new JPanel();

JPanel p6 = new JPanel();

JPanel p7 = new JPanel();

JPanel p8 = new JPanel();

JPanel p9 = new JPanel();

p1.add(l11); p2.add(k1);

p3.add(l12); p4.add(k2);

p5.add(l13); p6.add(k3);

p7.add(l14); p8.add(k4);

p9.add(butt); add(p1);

add(p2); add(p3);

add(p4); add(p5);

add(p6); add(p7);

add(p8); add(p9);

setVisible(true); }

private class revenuecalc implements ActionListener

{

public void actionPerformed(ActionEvent e) {

String priceticketadultperson;

String soldpro; String priceticketchild;

String soldc;

priceticketadultperson = k1.getText();

adultprice=Double.parseDouble(priceticketadultperson);

System.out.print(“answer”);

soldpro = k2.getText();

double grossA1 = (adultprice)* Double.parseDouble(soldpro);

double netAvalue = (grossA1) * percentage;

priceticketchild = k3.getText();

soldc = k4.getText();

double grossC1 = Double.parseDouble (priceticketchild)* Double.parseDouble(soldc);

double netCvalue = grossC1 * percentage; double totalGrossvalue = grossC1 + grossA1;

double totalNetvalue = netAvalue + netCvalue;

JOptionPane.showMessageDialog(null, “Total gross adult revenue values: ” +

grossA1 + “n” + “Total net value: + netAvalue “+ “n” + “Total gross child person value: ” +

grossC1 + “n” + “Total netchild value: ” + netCvalue + “n” + “Total gross sales: ” +

totalGrossvalue + “n” + “Total net sales: ” + totalNetvalue);

}

}

public static void main(String a[]) {

new GUIRevenueTheater();

}

}

Output:

Buy Essay
Calculate your paper price
Pages (550 words)
Approximate price: -

Help Me Write My Essay - Reasons:

Best Online Essay Writing Service

We strive to give our customers the best online essay writing experience. We Make sure essays are submitted on time and all the instructions are followed.

Our Writers are Experienced and Professional

Our essay writing service is founded on professional writers who are on stand by to help you any time.

Free Revision Fo all Essays

Sometimes you may require our writers to add on a point to make your essay as customised as possible, we will give you unlimited times to do this. And we will do it for free.

Timely Essay(s)

We understand the frustrations that comes with late essays and our writers are extra careful to not violate this term. Our support team is always engauging our writers to help you have your essay ahead of time.

Customised Essays &100% Confidential

Our Online writing Service has zero torelance for plagiarised papers. We have plagiarism checking tool that generate plagiarism reports just to make sure you are satisfied.

24/7 Customer Support

Our agents are ready to help you around the clock. Please feel free to reach out and enquire about anything.

Try it now!

Calculate the price of your order

Total price:
$0.00

How it works?

Follow these simple steps to get your paper done

Place your order

Fill in the order form and provide all details of your assignment.

Proceed with the payment

Choose the payment system that suits you most.

Receive the final file

Once your paper is ready, we will email it to you.

HOW OUR ONLINE ESSAY WRITING SERVICE WORKS

Let us write that nagging essay.

STEP 1

Submit Your Essay/Homework Instructions

By clicking on the "PLACE ORDER" button, tell us your requires. Be precise for an accurate customised essay. You may also upload any reading materials where applicable.

STEP 2

Pick A & Writer

Our ordering form will provide you with a list of writers and their feedbacks. At step 2, its time select a writer. Our online agents are on stand by to help you just in case.

STEP 3

Editing (OUR PART)

At this stage, our editor will go through your essay and make sure your writer did meet all the instructions.

STEP 4

Receive your Paper

After Editing, your paper will be sent to you via email.

× How can I help you?