Click here to Skip to main content
14,639,459 members
Rate this:
Please Sign up or sign in to vote.
See more:
Hai Friends,


i want source code for how to calculate the ticket price based upon entering the value like

no of person:..........
no of adult:..........
finally i want to calculate the total ticket price based upon those value which entered by user.........please anyone help me to find solution for this problem.......



Thanks,
With regards,
Vidhya.S
Posted
Rate this:
Please Sign up or sign in to vote.

Solution 1

Do they not teach elementary mathematics any more?

Total price = (price per child ticket * number of child tickets) + (price per adult ticket * number of adult tickets)


What part of this is giving you difficulties?
   
Rate this:
Please Sign up or sign in to vote.

Solution 2

simple.
total price = no of person * ticket price

if you want more details please elaborate your question.
   
Rate this:
Please Sign up or sign in to vote.

Solution 3

This is dependent on the business and the company, consult your business analyst for the formula in question.
   
v2
Rate this:
Please Sign up or sign in to vote.

Solution 4

Hi,

Here community people at codeproject will not provide you the source code of your homework. but your query or bugs will be resolved by their guidance. So request you to start reading C#, Windows Forms and other related stuff.

you can start with C# 4.0 Nutshell[^] (i always recommend my friends to read this book :) )


hope this information will help you,

Thanks
-Amit
   
Rate this:
Please Sign up or sign in to vote.

Solution 5

Use this code if you are not using this code for business purpose. If yes then contact your Business Analyst for the formulae


const double adultTicketPrice = 10.50;
const double childrenTicketPrice = 5.50;
const int numberOfAdults = 10;
const int numberOfChildrens = 5;
double sum = FindTicketAmount(adultTicketPrice, childrenTicketPrice, numberOfAdults,numberOfChildrens);


private double FindTicketAmount(double adultTicketPrice, double childrenTicketPrice, int numberOfAdults, int numberOfChildrens)
        {
            return ((adultTicketPrice*numberOfAdults) + (childrenTicketPrice*numberOfChildrens));
        }
   
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100