I need help in coding this program below in C#. Anyone's help is greatly appreciated..
Our ticket brokers (by my office) need a little program to assist them in better analyzing secondary market value evaluation of Knicks tickets at MSG.
User (the broker) will enter two or more ticket's information into the program.
For each ticket, the following information is provided:
1) Section: an integer value (ex. 101, 215 etc)
2) Row: an integer value (ex. 1, 20 etc)
3) Price: The price of the ticket
Your program is to output the section, row and price of the cheapest and most expensive tickets entered. It also needs to report the average ticket price.
Collect the input and do all the computation in the main() function. However, you will need to write a new function -- name it DisplayResults() -- that will output the results. In the main() function, you will call DisplayResults(), and send in the row, section and price of the cheapest and the most expensive ticket along with the average price of all tickets. Inside DisplayResults() function, you will display these values in a user friendly manner. Here is a screenshot of the program:
In case you need it, I have a suggested set of steps to follow:
Declare variables for:
minTicketPrice, minTicketSection, minTicketRow -- these will hold the cheapest ticket information.
maxTicketPrice, maxTicketSection, maxTicketRow -- these will hold the most expensive ticket information.
count -- this will be entered by the user telling us how many tickets he has
price, section, row -- these will be entered by the user for each ticket (inside the loop).
sum -- we will use this variable to sum up the prices of all tickets (to find average later on).
initialize minTicketPrice to a large number (ex 9999999).
initialize maxTicketPrice to a small number (ex. -1)
Ask user how many tickets he has (count).
Setup a loop that will repeat a set of statements for count many times.
Inside this loop, ask for ticket information (price, section and row).
If price of this ticket is larger than maxTicketPrice, then set maxTicketPrice, maxTicketSection and maxTicketRow to price, section and row, respectively.
If price of this ticket is smaller than minTicketPrice, then set minTicketPrice, minTicketSection and minTicketRow to price, section and row, respectively.
Add the price of the ticket to sum.
Find average ticket price, which is basically dividing sum to count.
Send minTicketPrice, minTicketSection, minTicketRow, maxTicketPrice, maxTicketSection, maxTicketRow and average you computed in step 6 to a function called DisplayResults.
Write a function that takes minTicketPrice, minTicketSection, minTicketRow, maxTicketPrice, maxTicketSection, maxTicketRow and average as input. You will use cout to output this information in a user friendly manner.
Sorry to say this, but there are people with genuine problems, whose threads get lost in the middle of messages like this one, so think about them when you decide to post something like this again, and think about you when you will be in the same situation - you wouldn't like it if others get in front of you with useless stuff.