Concept explainers
A movie theater only keeps a percentage of the revenue earned from ticket sales. The remainder goes to the movie company. Create an application that calculates and displays the following figures for one night’s box office business at a theater:
- a. GROSS REVENUE FOR ADULT TICKETS SOLD. This is the amount of money taken in for ail adult tickets sold.
- b. 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.
- c. GROSS REVENUE FOR CHILD TICKETS SOLD. This is the amount of money taken in for all child tickets sold.
- d. 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.
- e. TOTAL GROSS REVENUE. This is the sum of gross revenue for adult and child tickets sold.
- f. TOTAL NET REVENUE. This is the sum of net revenue for adult and child tickets sold.
The application s form should resemble the one shown in Figure 3-61.
Figure 3-61 Theater Revenue form in the Designer
Assume the theater keeps 20% of its box office receipts. Use a named constant in your code to represent this percentage. If the user fails to enter numeric values, display an appropriate error message and do not attempt to perform calculations. Use the following test data to determine if the application is calculating properly:
Trending nowThis is a popular solution!
Chapter 3 Solutions
Starting Out With Visual Basic (7th Edition)
- For each of the following exercises, you may choose to write a console-based or GUI application, or both. Write a program for The Carefree Resort named ResortPrices that prompts the user to enter the number of days for a resort stay. Then display the price per night and the total price. Nightly rates are $200 for one or two nights; $180 for three or four nights; $160 for five, six, or seven nights; and $145 for eight nights or more.arrow_forwardThe Donut Shoppe sells four varieties of doughnuts: Glazed (1.05), Sugar (1.05), Chocolate (1.25), and Filled (1.50). It also sells regular coffee (1.50) and cappuccino (2.75). The store manager wants you to create an application that displays a customers subtotal, 6% sales tax, and total due. Create a Windows Forms application. Use the following names for the project and solution, respectively: Donut Project and Donut Solution. Save the application in the VB2017\Chap06 folder. Create the interface shown in Figure 6-57. When coding the application, use one independent Sub procedure to determine the subtotal, which is the total cost without the sales tax. Use a function to determine the sales tax. Use an event-handling Sub procedure to clear the output. Save the solution and then start and test the application.arrow_forwardIn this exercise, you modify the Grade Calculator application from this chapter’s Apply lesson. Use Windows to make a copy of the Grade Solution folder. Rename the copy Grade Solution-Intermediate. Open the Grade Solution.sln file contained in the Grade Solution-Intermediate folder. Open the CourseGrade.vb file. The DetermineGrade method should accept an integer that represents the total number of points that can be earned in the course. (Currently, the total number of points is 200: 100 points per test.) For an A grade, the student must earn at least 90% of the total points. For a B, C, and D grade, the student must earn at least 80%, 70%, and 60%, respectively. If the student earns less than 60% of the total points, the grade is F. Make the appropriate modifications to the DetermineGrade method and then save the solution. Unlock the controls on the form. Add a label control and a text box to the form. Change the label control’s Text property to “&Maximum points:” (without the quotation marks). Change the text box’s name to txtMax. Lock the controls and then reset the tab order. Open the form’s Code Editor window. The txtMax control should accept only numbers and the Backspace key. Code the appropriate procedure. The grade should be cleared when the user makes a change to the contents of the txtMax control. Code the appropriate procedure. Modify the frmMain_Load procedure so that each list box displays numbers from 0 through 200. Locate the btnDisplay_Click procedure. If the txtMax control does not contain a value, display an appropriate message. The maximum number allowed in the txtMax control should be 400; if the control contains a number that is more than 400, display an appropriate message. The statement that calculates the grade should pass the maximum number of points to the studentGrade object’s DetermineGrade method. Make the necessary modifications to the procedure. Save the solution and then start and test the application.arrow_forward
- In Chapter 2, you created a program for Marshalls Murals that prompts a user for the number of interior and exterior murals scheduled to be painted during the next month. The program computes the expected revenue for each type of mural when interior murals cost $500 each and exterior murals cost $750 each. The application should display, by mural type, the number of murals ordered, the cost for each type, and a subtotal. The application also displays the total expected revenue and a statement that indicates whether more interior murals are scheduled than exterior ones. Now create an interactive GUI program named MarshallsRevenueGUI that performs all the same tasks.arrow_forwardThe purpose of this exercise is to demonstrate the importance of testing an application thoroughly. Open the FixIt Solution.sln file contained in the VB2017\Chap04\FixIt Solution folder. The application displays a shipping charge that is based on the total price entered by the user, as shown in Figure 4-64. Start the application and then test it by clicking the Display shipping button. Notice that the Shipping charge box contains $13, which is not correct. Now, test the application using the following total prices: 100, 501, 1500, 500.75, 30, 1000.33, and 2000. Here too, notice that the application does not always display the correct shipping charge. (More specifically, the shipping charge for two of the seven total prices is incorrect.) Open the Code Editor window and correct the errors in the code. Save the solution and then start and test the application.arrow_forwardA Costume shop requests a Computer application that advertizes Costume rentals. This week's Costume rental specials are as follows : Table Costume Price per week Renaissance Fair $40 Stormtrooper $49 Batman / Batgirl $36 Pirate $29 Write an application that allows the user to select any of the five costume rental specials. When the user selects a costume, the corresponding cost and a picture of the costume should be displayed. Clear each prior price and picture when the user selects a different costume. After selecting a costume, the user should be able to book the costume rental and then CLOSE the window. Visual BAsicsarrow_forward
- A Costume shop requests a Computer application that advertizes Costume rentals. This week's Costume rental specials are as follows : Table Costume Price per week Renaissance Fair $40 Stormtrooper $49 Batman / Batgirl $36 Pirate $29 Write an application that allows the user to select any of the five costume rental specials. When the user selects a costume, the corresponding cost and a picture of the costume should be displayed. Clear each prior price and picture when the user selects a different costume. After selecting a costume, the user should be able to book the costume rental and then CLOSE the window. Show screenshot of workarrow_forwardThere are three seating categories at a high school athletic stadium. For a baseball game, Class A seats cost $15 each, Class B seats cost $12 each, and Class C seats cost $9 each. Create an application that allows the user to enter the number of tickets sold for each class. The application should be able to display the amount of income generated from each class of ticket sales and the total revenue generated. If the user fails to enter numeric values, display an appropriate error message and do not attempt to perform calculations. Use the following test data to determine if the application is calculating properly:Ticket Sales RevenueClass A: 320 Class A: $4800.00Class B: 570 Class B: $6840.00Class C: 890 Class C: $8010.00Total Revenue: $19650.00Class A: 500 Class A: $7500.00Class B: 750 Class B: $9000.00Class C: 1200 Class C: $10800.00Total Revenue: $27300.00Class A: 100 Class A: $1500.00Class B: 300 Class B: $3600.00Class C: 500 Class C: $4500.00Total Revenue: $9600.00 Use Visual…arrow_forwardThere are three seating categories at a high school athletic stadium. For a baseball game, Class A seats cost $15 each, Class B seats cost $12 each, and Class C seats cost $9 each. Create an application that allows the user to enter the number of tickets sold for each class. The application should be able to display the amount of income generated from each class of ticket sales and the total revenue generated. If the user fails to enter numeric values, display an appropriate error message and do not attempt to perform calculations Use the following test data to determine if the application is calculating properly:Ticket Sales RevenueClass A: 320 Class A: $4800.00Class B: 570 Class B: $6840.00Class C: 890 Class C: $8010.00Total Revenue: $19650.00Class A: 500 Class A: $7500.00Class B: 750 Class B: $9000.00Class C: 1200 Class C: $10800.00Total Revenue: $27300.00Class A: 100 Class A: $1500.00Class B: 300 Class B: $3600.00Class C: 500 Class C: $4500.00Total Revenue: $9600.00arrow_forward
- Falling Distance When an object is falling because of gravity, the following formula can be used to determine the distance the object falls in a specific time period: d =1/2gt2 The variables in the formula are as follows: d is the distance in meters, g is 9.8, and t is the amount of time in seconds that the object has been falling. Create an application that allows the user to enter the amount of time that an object has fallen and then displays the distance that the object fell. The application should have a method named FallingDistance. The FallingDistance method should accept an object’s falling time (in seconds) as an argument. The method should return the distance in meters that the object has fallen during that time interval.arrow_forwardKinetic Energy In physics, an object that is in motion is said to have kinetic energy. The following formula can be used to determine a moving object’s kinetic energy: KE =1/2mv2 In the formula KE is the kinetic energy, m is the object’s mass in kilograms, and v is the object’s velocity in meters per second. Create an application that allows the user to enter an object’s mass and velocity and then displays the object’s kinetic energy. The application should have a method named KineticEnergy that accepts an object’s mass (in kilograms) and velocity (in meters per second) as arguments. The method should return the amount of kinetic energy that the object has.arrow_forwardPaint Job Estimator A painting company has determined that for every 115 square feet of wall space, 1 gallon of paint and 8 hours of labor will be required. The company charges $20.00 per hour for labor. Create an application that allows the user to enter the square feet of wall space to be painted and the price of the paint per gallon. The program should display the following data: • The number of gallons of paint required • The hours of labor required • The cost of the paint • The labor charges • The total cost of the paint jobarrow_forward
- Programming with Microsoft Visual Basic 2017Computer ScienceISBN:9781337102124Author:Diane ZakPublisher:Cengage LearningMicrosoft Visual C#Computer ScienceISBN:9781337102100Author:Joyce, Farrell.Publisher:Cengage Learning,Programming Logic & Design ComprehensiveComputer ScienceISBN:9781337669405Author:FARRELLPublisher:Cengage
- EBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENT