Calculate the cost of that order and add

Assignment Help Python Programming
Reference no: EM132111977

Python

A good friend of yours is managing a fund raiser for a football team. He needs a program to calculate the total amount of candy sold at a football game.

The team is selling Candy Bars for $1.5, Gum for $0.75 and Licorice for $1.25. The program needs to ask the user how many pieces of candy was just sold and what type. To make data entry easiest, allow the user to enter C for Candy Bars, G for Gum and L for licorice.

The program will then calculate the cost of that order and add it to all previous orders. The program will continue to accept more Candy until the user enters quit.

Below is what the output should look like!

What kind of candy did you sell (C = Candy Bar, G = Gum, L = Licorice): C How many did you sell: 4 Your subtotal is: $ 6.00 Enter 'quit' to end the program: What kind of candy did you sell (C = Candy Bar, G = Gum, L = Licorice): G How many did you sell: 2 Your subtotal is: $ 1.50 Enter 'quit' to end the program:

What kind of candy did you sell (C = Candy Bar, G = Gum, L = Licorice): L How many did you sell: 3 Your subtotal is: $ 3.75 Enter 'quit' to end the program: What kind of candy did you sell (C = Candy Bar, G = Gum, L = Licorice): C How many did you sell: 5 Your subtotal is: $ 7.50 Enter 'quit' to end the program: quit Your total is: $ 18.75.

Reference no: EM132111977

Questions Cloud

The first ten elements in the periodic table : Create a list of tuples that holds the information about the first 10 elements in the periodic table .
Find the sub game perfect nash equilibrium : Find the sub game perfect Nash equilibrium of this two-stage game - discuss how the Trump tariff affects (i) the prices of smartphones, (ii) the market share
Write a program that will prompt the user for temperature : Add this static method to your program. Use the output of the cToF conversion method as the input for the fToC conversion method.
Write a string expression whose value is the string : Write a string expression whose value is the string equivalent of each these variables joined by a single period .
Calculate the cost of that order and add : A good friend of yours is managing a fund raiser for a football team. He needs a program to calculate the total amount of candy sold at a football game.
Write a function named init that takes one argument : Write a function named init that takes one argument, a tuple of the proper length, and returns an tuple initialized as described above.
Write a program to validate rowan student ids : All student ids must have length=9, they must start with "916" and they must consist of all numbers (no letters, hyphens, etc).
Write code to find the index of the second occurrence : Let L be a list and let T be a target. Write code to find the index of the second occurrence of T in the list.
Write and test a pep assembly language program : Write and test a Pep/9 assembly language program that inputs N and outputs the total cost of mailing the widgets.

Reviews

Write a Review

Python Programming Questions & Answers

  Define a class for representing a distance

Define a class for representing a distance (with one attribute that represents the distance in inches).

  Write a program that asks the user for a letter

Write a program that asks the user for a letter - This function will take as input the original letter input by the user so that it can be included in the output sentence.

  Topic of effective and ethical communication

Design an algorithm and use it to write a Python program that reads the contents of the data file into a list. The program should then loop, to allow a user to check various numbers against those stored in the list.

  Calculate the subject marks of a student

ISY1003 – Foundations of Programming - calculate the subject marks of a student. The input data for the program includes: the raw marks of assignment, test

  Implement a complete version of a hash table

FIT1008 - Intro to Computer Science - Implement a complete version of a hash table using Linear Probing to resolve collisions and implement dynamic hashing

  Write a python program that generates a small web site

Choose a sport or club, and get some suitable input data.. If you play a sport yourself, see if you can get some data files for your sport.

  Data wrangling - child mortality

ICT702 - Data Wrangling - Child Mortality - Develop creative approaches to solving the wrangling/analysis problems - Write programs that produce correct

  Define the playround method with only the self parameter

Define the playRound method with only the self parameter. Make a call to another instance method called doRolls that takes no arguements.

  Two-dimensional word puzzle

Write a python function called find_words that finds and prints the list of valid words in a two-dimensional word puzzle

  Write a program using the following python functions

You are required to write the following Python functions. Make sure you understand where each function fits into the system described above.

  Question 1 research 5-8 species within one family of birds

question 1 research 5-8 species within one family of birds. be sure to use primary or very good secondary literature

  Implement the remaining simple arithmetic operators

Implement the remaining simple arithmetic operators (_sub__, __mul __ and truediv ___). Implement the remaining relational operators.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd