Preview

Python - Menu Program

Satisfactory Essays
Open Document
Open Document
1437 Words
Grammar
Grammar
Plagiarism
Plagiarism
Writing
Writing
Score
Score
Python - Menu Program
#Marius Mazuolis
#14-12-2012
#assignment Menu Program

#-------------------------------------
#open file and read data assining it to 2 dimension list def openFile(fileName): bufferFile = open(fileName) bufferTxt = bufferFile.read() bufferFile.close() bufferLines = bufferTxt.split("\n") bufferTable = [] ln=0 for line in bufferLines: if len(line) > 0: if ln != 0: dataLine = line.split(",") dataLine[0] = dataLine[0].capitalize() bufferTable = bufferTable + [dataLine] else: dataLine = line.split(",") for dt in dataLine: i = dataLine.index(dt) dataLine[i] = dt.upper() bufferTable = bufferTable + [dataLine] ln+=1 return bufferTable
#-------------------------------------

#-------------------------------------
#function to check if number less than 10 to add 0 in front
#(send 9 receive 09) def lessThan10(number): if number < 10: number = "0" + str(number) else: number = str(number) return number
#-------------------------------------

#-------------------------------------
#format price def formatPrice(pricesss): if float(pricesss) < 10: pricesss = "£ {:.2f}".format(float(pricesss)) else: pricesss = "£ {:.2f}".format(float(pricesss)) return pricesss
#-------------------------------------

#-------------------------------------
#print all Data in nice formated table def printallTable(): print(' '.ljust(25),'Full menu list of the dishes'.upper()) print('') ln = 0 for line in allTable: if ln!= 0: dishNo = lessThan10(ln) + " - " print(dishNo.ljust(5), line[0].ljust(12), line[1].ljust(30) ,formatPrice(line[2]).ljust(8),line[3].ljust(8)) else: print("No - ",line[0].ljust(12),

You May Also Find These Documents Helpful

  • Good Essays

    Nt1310 Unit 5 Lab Report

    • 490 Words
    • 2 Pages

    INPUT ADDRESS OUTPUT ADDRESS 0.01 – defected bottle Shift 0.02 – shift and counter Shift 0.03 Shift 10.00 100.01 10.01 100.02 10.02 100.03 10.03 100.04…

    • 490 Words
    • 2 Pages
    Good Essays
  • Satisfactory Essays

    04 05 Personal Menu

    • 1077 Words
    • 11 Pages

    Copy and paste the following information into a word processing document. Complete each of the five daily calorie logs. Answer the reflection questions completely with supporting details.…

    • 1077 Words
    • 11 Pages
    Satisfactory Essays
  • Satisfactory Essays

    CEIS100 W5 ILab Report

    • 320 Words
    • 2 Pages

    Code—copy and paste (or type) your code below. You can also post a screenshot of the program working if you would like.…

    • 320 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Unit 7 Assignment 1

    • 261 Words
    • 2 Pages

    2. A pretest loop is a loop tests the conditions before performing the iteration. A posttest loop performs the iteration then test the condition.…

    • 261 Words
    • 2 Pages
    Satisfactory Essays
  • Good Essays

    Income Tax

    • 950 Words
    • 11 Pages

    8 Subtract line 7 from line 6. If zero or less, enter -0-. However, if line 7…

    • 950 Words
    • 11 Pages
    Good Essays
  • Powerful Essays

    food tech ass task 1

    • 1595 Words
    • 7 Pages

    Consumers are a dynamic market in the world, their needs change according to their lifestyle which ultimately affects their food choice. Consumers range from household to career driven and often cater their food choices to their lifestyle, for example, a busy athlete will consume a protein shake on the go, whereas a domestic housewife will engage in a nutritional breakfast meal such as cereal. Consumers need fast, efficient and convenient food products that suit their lifestyle while providing them with nutritional and healthy benefits to fuel their actions for the day.…

    • 1595 Words
    • 7 Pages
    Powerful Essays
  • Satisfactory Essays

    Papa John's Menu Analysis

    • 262 Words
    • 2 Pages

    Papa John’s is a pizza delivery and carryout chain that was founded in 1985 by John Schnatter in Jeffersonville, Indiana. Schnatter had a goal to build a better pizza than that of his competitors by focusing on fresh quality ingredients. This focus on quality lead to the slogan “better ingredients, better pizza.” Today Papa John’s is ranked the third largest retailer of quick service pizza in the world due to great customer service and an offering of quality ingredients. The company typically competes with Pizza Hut, Dominoes, and Little Caesar’s within the pizza market. Papa John’s chose abandoned the traditional pizzeria menu that includes pastas and salads and instead focused on a few items and the quality thereof. The company’s menu consists…

    • 262 Words
    • 2 Pages
    Satisfactory Essays
  • Best Essays

    References: ExpectMore.gov: National School Lunch. (n.d.). The White House. Retrieved April 18, 2011, from http://www.whitehouse.gov/omb/expectmore/detail/10000452.2006.html…

    • 3479 Words
    • 14 Pages
    Best Essays
  • Satisfactory Essays

    School Lunch Case Study

    • 228 Words
    • 1 Page

    For some families it is hard to get everything they need because of cost. Some people think that the estimated $2.50 isn’t a lot, but it adds up and the food for lunches that they have at home have to be rationed out for the weekends so it can’t be brought to school Samantha Cowan stated in www.takepart.com that “...those from low income families rely on school meals for up to half their daily energy intake…” If school lunches are the only thing filling them up they should contain more vitamins and nutrients in it so they stay healthy even without a lot of money. Also from healthland.time.com some districts lost $30,000 because lunch prices were too high and kids started bringing a lunch to school. If that much money is lost because of lunch…

    • 228 Words
    • 1 Page
    Satisfactory Essays
  • Best Essays

    School Lunch Program

    • 1238 Words
    • 5 Pages

    In response to the budget bill recently introduced to Congress to cut the funding for the…

    • 1238 Words
    • 5 Pages
    Best Essays
  • Powerful Essays

    The mother looks at her children before she sends them off to school and thinks about how they’re day will go and if they will be eating right. She had packed them lunches while she apprehensively thinks about the school cafeteria food. Can you believe that so many children in elementary schools do not bring their lunch to school because parents feel that it’s more convenient or a time saver in the mornings, so their kids eat the school cafeteria food? This topic is fascinating because little do most parents know what kind of food their child is being fed. Everyone should be aware of the many risks that are involved when sending their children off to school with the expectation that their kids will get a healthy meal. Along with knowing that their child is getting a healthy meal, many can agree that eating the school cafeteria food is a leading cause in childhood obesity. First, when parents make their children’s lunches many will have a sandwich, which will contain the nutrients of carbohydrates in the bread and protein in the meat. Along with a healthy sandwich many will also pack a fruit as well as a simple desert, such as jello or pudding. This lunch for a child is a very healthy and satisfying one because it contains food from almost all of the food groups. Schools should start allowing for some healthier choices of foods inside their cafeterias because of the unhealthy effects and serious health risks it has on students in grades K-12 and because most schools have only made matters worse by including competitive foods such as fast food and other nutritionally inadequate foods on their menus in order to meet the wide range of tastes of the students.…

    • 2126 Words
    • 9 Pages
    Powerful Essays
  • Good Essays

    We the people should think about using labels on restaurant and fast food menus. I think we should use them because it will really improve our health issues. The labels will show people how many calories they are getting or need. There are three reasons why I think we need labels on food menus. They are people consume 18% of their calories at home. The other one is 30 years later, which is these present days they have risen to 33% of calories received away from home. The last reason is some coffee contain 100 fewer calories than it supposed to.…

    • 341 Words
    • 2 Pages
    Good Essays
  • Satisfactory Essays

    A Dinner Menu

    • 287 Words
    • 2 Pages

    Tonight I am preparing a dinner for my friend's Birthday Party. The party can't happen if there're no food so i plan to make the food for them, and the food that i'm going to make is Mixed field greens salad, Beef Tenderloin , chicken wings and the cheesecake for the dessert . Furthermore, there're so many people coming to this party so i have to make sure if there're enough foods for everybody.…

    • 287 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    School Lunch Programs

    • 166 Words
    • 1 Page

    The United States Federal Government should be involved in the choices made by school lunch programs. From choosing food offerings and changing what schools currently provide in lunchroom, the United States Federal Government needs to be active in the entire process. Our school systems are a good place to start to try to combat obesity. Unfortunately, in our society it is a lot cheaper to buy unhealthy fast food for example then to go to the grocery store and purchase healthy foods. If the government gets involved and puts more various programs forth to help children at an early age to crave and know the importance of healthy material. Government is the basis of this country and its up to them to make important choice, for this country. Our…

    • 166 Words
    • 1 Page
    Satisfactory Essays
  • Best Essays

    Restaurant Analysis

    • 4130 Words
    • 17 Pages

    In the following analytical report, the financial performance of Bob’s Restaurants is assessed. Operating Performance & Selected Sheet Items for the years of 1997-2004 was provided along with Stock Price Performance for Fiscal Years 1996-2004. The results of the analysis were then compared with the industry standards in order to demonstrate Bob’s Restaurants standing in the restaurant industry.…

    • 4130 Words
    • 17 Pages
    Best Essays

Related Topics