Webb7 okt. 2024 · else if (age >= 0 && age <= 3) cout << " The price of your ticket is: $ " << price << endl ; if ( age >= 4 && age <= 64) cout<< " The price of your ticket is: $ " << price << endl ; if (age > 65) cout<< " The price of your ticket is: $ " << price << endl ; You seem to be doing the exact same thing regardless of the condition! Webb19 nov. 2013 · Based on the context, it looks like n and q should respectively be named productNumber and productQuantity. The sum += 0 in the default looks unnecessary. Just remove it if so, even if it's only there to have the default do something. Keep things simple. Share Improve this answer edited Nov 19, 2013 at 2:47 answered Nov 19, 2013 at 2:00 …
How to code for discount function in javascript? - CodeProject
Webb24 maj 2015 · Calculate the gross amount using the following formula: grossAmount = adultTicketPrice * noOfAdultTicketsSold + childTicketPrice * noOfChildTicketsSold 8. Calculate the amount donated to charity using the formula: = grossAmount * percentDonation / 100; 9. Calculate the net sale amount: netSaleAmount = grossAmount … Webb5 jan. 2015 · Write a program that will calculate the cost of a ticket order and display the receipt for the customer on the screen. There are 2 ticket prices: adult, and senior citizen. Adult seats are $4.50 and senior citizen seats are $3.50. If more than 5 senior citizen tickets are purchased, the customer gets an extra 20% off the of the ticket order. passeata bolsonaro 2022
Train ticket machine - Java Example - YouTube
Improve this question. Create a class Ticket with the following private variables. int ticketid; int price; static int `availableTickets`; Include getters and setters methods in the Ticket class. Available Tickets should hold only positive value. Zero and negative values are not allowed. Webb1 jan. 2024 · This is a movie tickets sales program written using the Java programming language. A user of the program can select the movie they want to view, date, time, and … Webb11 mars 2024 · For example : A pen costs 50$ and it is been sold at a discount of 12%, what is the discount price of the pen? A: = 50 x 12/100. = 50 × 0.12. = $ 6. Discount price of the pen is : 44$. Hope you get it. Okay fine! Let’s get into the programming for the above equation is different formats. passeata 7 setembro