Notes![what is notes.io? What is notes.io?](/theme/images/whatisnotesio.png)
![]() ![]() Notes - notes.io |
#Local constants
lc_CLASS_A_PRICE = 30.00
lc_CLASS_B_PRICE = 15.00
lc_CLASS_C_PRICE = 10.00
#Local variables for number of tickets sold
lv_ticketsSoldA = 0
lv_ticketsSoldB = 0
lv_ticketsSoldC = 0
#Local variables for total income for each ticket class
lv_totalSalesA = 0.0
lv_totalSalesB = 0.0
lv_totalSalesC = 0.0
#Local variable for total income from all ticket sales
lv_totalIncome = 0.0
#Get number of tickets sold for each ticket class
lv_ticketsSoldA = getTicketsSold("A")
lv_ticketsSoldB = getTicketsSold("B")
lv_ticketsSoldC = getTicketsSold("C")
#Calculate total income for each ticket class
lv_totalSalesA = calcTicketClassTotal(lv_ticketsSoldA,
lc_CLASS_A_PRICE)
lv_totalSalesB = calcTicketClassTotal(lv_ticketsSoldB,
lc_CLASS_B_PRICE)
lv_totalSalesC = calcTicketClassTotal(lv_ticketsSoldC,
lc_CLASS_C_PRICE)
#Calculate total income generated from all ticket classes
lv_totalIncome = calcTotalIncome(lv_totalSalesA,
lv_totalSalesB,
lv_totalSalesC)
#Print ticket class income
printAllClassIncome(lv_totalSalesA, lv_totalSalesB, lv_totalSalesC)
#Print total incoome
printTotalIncome(lv_totalIncome)
def getTicketsSold(pv_classCode = ""):
lv_numberOfTickets = 0.0
lv_numberOfTickets = float(input("Please enter the number of class "
+ pv_classCode + " tickets sold:"))
return lv_numberOfTickets
def calcTicketClassTotal(pv_totalTickets = 0,
pv_ticketPrice = 0.0):
return pv_totalTickets * pv_ticketPrice
def calcTotalIncome(pv_classTotalA = 0.0,
pv_classTotalB = 0.0,
pv_classTotalC = 0.0):
return (pv_classTotalA
+ pv_classTotalB
+ pv_classTotalC)
def printClassIncome(pv_classCode = "",
pv_classIncome = 0.0):
print("Class "+ pv_classCode + " sales:" + format(pv_classIncome,"12.2f"))
def printAllClassIncome(pv_classTotalA = 0.0,
pv_classTotalB = 0.0,
pv_classTotalC = 0.0):
printClassIncome("A", pv_classTotalA)
printClassIncome("B", pv_classTotalB)
printClassIncome("C", pv_classTotalC)
def printTotalIncome(pv_totalIncome = 0.0):
print(" Total sales:" + format(pv_totalIncome,"12.2f"))
main()
![]() |
Notes is a web-based application for online taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000+ notes created and continuing...
With notes.io;
- * You can take a note from anywhere and any device with internet connection.
- * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
- * You can quickly share your contents without website, blog and e-mail.
- * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
- * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.
Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.
Easy: Notes.io doesn’t require installation. Just write and share note!
Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )
Free: Notes.io works for 14 years and has been free since the day it was started.
You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;
Email: [email protected]
Twitter: http://twitter.com/notesio
Instagram: http://instagram.com/notes.io
Facebook: http://facebook.com/notesio
Regards;
Notes.io Team