Eazyd's Posts
Nairaland Forum › Eazyd's Profile › Eazyd's Posts
Thanks! show your python result too. Once i confirm where my mistake is,i will do another program and let u check for me. Thanks for your help. |
@goon,can you do this in python 2 pls. |
@goon i use a book called Programming Logic & Design by Tony Gaddis. Thanks for the simple module. i use python 2. |
I guess you using access which is easy to create rows and columns, state your DBMS and you will get help! |
hi sweet-pawn! please i need help on my python program- i wrote the program but i keep getting errors can u pls run it and tell me what to do. here's the program There are three seating categories at a stadium. For a softball game, Class A seats cost $15, Class B seats cost $12, and Class C seats cost $9. Design a module program that asks how many tickets for each class of seats were sold, and then displays the amount of income generated from ticket sales. # This program calculates the income generated from ticket sales # Class A seats cost $15, Class B seats cost $12, Class C seats cost $9 # mainline logic def main(): intro() # call the intro function readInput() # call readInput function # This function displays some introductory messages def intro(): print("Welcome to the Ticket Sales Program" ![]() print("Class A seats cost $15" ![]() print("Class B seats cost $12" ![]() print("Class C seats cost $9" ![]() print("You will be asked to enter the number of tickets sold in each of the three categories" ![]() print("The program will then calculate the income generated from all the sales" ![]() print() raw_input("Press any Key when you are ready to begin" ![]() # This programs reads the readInput function def readInput(): numClassA = numClassB = numClassC = # This function calculates the sales from the three categories def calcSales(numClassA, numClassB, numClassC): salesClassA = numClassA * 15 salesClassB = numClassB * 12 salesClassC = numClassC * 9 print("The income generated for Class A seats: $%7.2f" % salesClassAprint("The income generated for Class B seats: $%7.2f" % salesClassBprint("The income generated for Class C seats: $%7.2f" % salesClassCtotalSales(totalSales) # This function outputs the income generated def outputSales(Sales): print("\nThe total income generated for the softball game is $%7.2f" % sales# call the main function main() |
I did call the function and passed a value to it- i use Programming Logic & Design by Tony Gaddis! can you just show me some workings,i learn from examples, i have written some programs but this tend to somehow confuse me and i know its just a lil error from me but i can't see m to figure it out dats why i need help. If i get it,i know for a fact that mistake will never be made again, i read your posts and you are an expert in python. if you got time to re design this program and i will compare and contrast with what i did.That way i know what to do next time. |
@DonSegmond do i call this function with 0 since at this point they have no value. how do i call this function? |
i just defined it- def readInput(): numClassA = 15 numClassB = 12 numClassC = 9 does the program makes sense to you when you ran it? i did run it but it didn't calculate the total sales! |
my outcome was an error (NameError: global name 'readInput' is not defined) and i thought i'd find help here, where all dis programmers na?? dis should be quite easy for a guru! me just start yesterday ![]() |
This is “my program” # This program calculates the income generated from ticket sales # Class A seats cost $15, Class B seats cost $12, Class C seats cost $9 # mainline logic def main(): intro() # call the intro function readInput() # call readInput function # This function displays some introductory messages def intro(): print("\tWelcome to the Ticket Sales Program" ![]() print("\tClass A seats cost $15" ![]() print("\tClass B seats cost $12" ![]() print("\tClass C seats cost $9" ![]() print("\tYou will be asked to enter the number of tickets sold in each of the three categories" ![]() print("\tThe program will then calculate the income generated from all the sales" ![]() print() raw_input("Press any Key when you are ready to begin" ![]() # This function calculates the sales from the three categories def calcSales(numClassA, numClassB, numClassC): salesClassA = numClassA * 15 salesClassB = numClassB * 12 salesClassC = numClassC * 9 print("The income generated for Class A seats: $%7.2f" % salesClassAprint("The income generated for Class B seats: $%7.2f" % salesClassBprint("The income generated for Class C seats: $%7.2f" % salesClassCtotalSales(totalSales) # This function outputs the income generated def outputSales(Sales): print("\nThe total income generated for the softball game is $%7.2f" % sales# call the main function main() |
My home work is done,just want to compare and contrast! I can post what i did if someone can do it too- thats how we learn! |
Can someone help design this module program for python. There are three seating categories at a stadium. For a softball game, Class A seats cost $15, Class B seats cost $12, and Class C seats cost $9. Design a module program that asks how many tickets for each class of seats were sold, and then displays the amount of income generated from ticket sales. Thanks! |

