Best writers. Best papers. Let professionals take care of your academic papers

Order a similar paper and get 15% discount on your first order with us
Use the following coupon "FIRST15"
ORDER NOW

Familiarization with basic data types Know how to declare variables & constants Using the Scanner Class to get various inputs Learn to write simple arithematic expression Using the escape sequence to align the output Using DecimalFormat class to format the output

What this Assignment Is About:

Familiarization with basic data types
Know how to declare variables & constants
Using the Scanner Class to get various inputs
Learn to write simple arithematic expression
Using the escape sequence to align the output
Using DecimalFormat class to format the output

Coding Guidelines for All Labs/Assignments (You will be graded on this)
Give identifiers semantic meaning and make them easy to read (examples numStudents, grossPay, etc).
Keep identifiers to a reasonably short length.
Use upper case for constants. Use title case (first letter is upper case) for classes. Use lower case with uppercase word separators for all other identifiers (variables, methods, objects).
Use tabs or spaces to indent code within blocks (code surrounded by braces). This includes classes, methods, and code associated with ifs, switches and loops. Be consistent with the number of spaces or tabs that you use to indent.
Use white space to make your program more readable.
Use comments properly before or after the ending brace of classes, methods, and blocks to identify to which block it belongs.

  1. Assignment Description
    A movie theater only keeps a percentage of the revenue earned from ticket sales. The remainder goes to the distributor. Write a program that calculates a theater’s gross and net box office profit for a night. The program should ask for the name of the movie, and how many adult and child tickets were sold. The price of an adult ticket is $9.50 and a child’s ticket is $6.50. It should display a report similar to the following:
    Revenue Report

Movie Name: Peter’s Dragon
Adult Tickets Sold: 182
Child Tickets Sold: 237
Gross Box Office Profit: $ 3269.50
Amount Paid to Distributor: $ 2615.60
Net Box Office Profit: $ 653.90

Assume the theater keeps 20% of the gross box office profit.

  1. What does the program need to compute?
  2. First, the program need to get user’s input, namely the movie’s name, quantity of adult tickets and child tickets sold, it then computes and show the outputs accordingly.
  3. Also your program must also meet all specifications stated as below:

See the sample run at the end of the specification. The exact spacing is not important, what is important is that the output looks good and the columns align.

Pick and use identifiers which are self-descriptive. One-letter variable names should not be used. As an example, if you were referring to the ticket price, the variable needed might be declared as double price; instead of double x;

As we stated before, make sure for each assignment, you put the following comment header block on top of the file:

//* // FILE: Assignment1.java // Name: your-name // Student ID: your-10-digits-ID // Description: // Course: Principles of Programming with Java //**

  1. Sample Run

Note: User input is enclosed by [ ] in bold.

Name of the movie: [Peter’s Dragon]
Number of adult tickets sold: [182]
Number of child tickets sold: [237]

Revenue Report

Movie Name: Peter’s Dragon
Adult Tickets Sold: 182
Child Tickets Sold: 237
Gross Box Office Profit: $ 3269.50
Amount Paid to Distributor: $ 2615.60
Net Box Office Profit: $ 653.90

  1. Submission

1) Test your program by using the inputs from the following two input test cases, compare your program’s output with our solution output, make sure they are same before you submit the source file Assignment1.java. Read this short description on how to use test cases for your lab or assignments

2) For this assignment, after you successfully test your program on your own PC by using the two test cases we provided below, when you submit it on server, make sure you comment out (put // in front of the line) the 3 user prompts where you’re asked to enter movie’s name, number of adult & child tickets sold, i.e. put // in front of the following 3 lines as:

// System.out.print(“Name of the movie: “);

// System.out.print(“Number of adult tickets sold: “);

// System.out.print(“Number of child tickets sold: “);

  1. Grading Rubric (20 pts)

a. Student submits the relevant source code files, whether the program compiles and/or runs correctly or not. [2 pts]
b. Student pick descriptive variables’ name and declared constant(s) inside the program [2 pts]
c. Student put proper comments inside the program and the program is easy to read [2 pts]
d. Student use \n and \t properly format the program’s outputs according to the test cases [4 pt]
e. The program student submitted compiles, runs, and produces the correct output for the two test cases [10 pts]

 
Looking for a Similar Assignment? Order now and Get 10% Discount! Use Coupon Code "Newclient"