Question: Assignment 1 : Create classes and objects In this assignment C# in visual studios, WIndows Form create an Event class that will be used to
Assignment 1: Create classes and objects In this assignment
C# in visual studios, WIndows Form
create an Event class that will be used to hold information about each of the events at the Great Opera House. You need to be able to store the name of the event and the performer, time of the event, how many tickets are available, the cost of the tickets, and whether concession sales will be available. Be sure to use pair programming techniques as you develop your program. In particular, be sure to switch who is driving and who is navigating.
Methods:
Constructor to create an event object. Set values for all properties and fields. Ensure non-negative number of tickets.
A method named SellTicket that takes a number of tickets to sell and returns the total amount of the sale
A method named ReturnTicket that takes a number of tickets to be returned (e.g. tickets that had been previously sold) and returns the total amount of money to be returned to the buyer.
- ToString method that returns a string with event details on this format:
- [EventTitle] by [Performer] on [EventDate] at [EventTime]. Concessions: {Yes|No]. Tickets available: [NumTickets]. Ticket price: [TicketPrice].
- Example: Shrek by Osawa High School on 4/13/2016 at 7:00pm. Concessions: Yes. Tickets available: 134. Ticket Price: 12
Use the Program.cs class to test the Event class. Create at least three different Event objects, print out their status, and show how you can sell and return tickets.
Make sure the number of tickets available can never be negative, and can only be modified through the methods to sell and return tickets.
- Ensure that returns cant exceed the number of tickets originally assigned to the venue.
- Make the Program.cs program interactive and allow the user to create new events and modify specific events after they have been created.
- Make it INTERACTIVE
- Keep track of which tickets have been sold (i.e. if there are 100 tickets available, track that tickets number 1, 3, and 87 have been sold). When tickets are returned, make sure that the return matches a sold tickets
- Allow for ticket sales to request specific tickets or just sell the first available tickets if no ticket number is specified.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
