Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

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

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M93100218

Have any Question?


Related Questions in Computer Engineering

Explain why some organizations may not place enough

Explain why some organizations may not place enough importance on disaster recovery. What might happen to these organizations in the event of an actual disaster?

Command to move all the sh files from current folder to

Command to move all the .sh files from current folder to parent directory. (single line Unix)

Question can someone send me a complete produce a project

Question : Can someone send me a complete produce a project plan which results in the development of a major software product to solve a customer problem, for a Course Registration System.

Question suppose alice bob and carol want to use secret key

Question : Suppose alice, bob and carol want to use secret key technology to authenticate each other. If they all use the same key, K, then bob would impersonate carol to alice. suppose instead that each had their own se ...

Penetration testing is a technique used to identify

Penetration testing is a technique used to identify security weaknesses in your network. Discuss a type of penetration testing and the different methods utilized to recognize vulnerabilities in your network.

Question what is the smallest value of n such that an

Question : What is the smallest value of n such that an algorithm whose running time is 1000n 2 runs faster than an algorithm whose running time is 4 n & on the same machine? Justify your answer. The response must be typ ...

Question suppose 4 packets of a message each of l bits

Question : Suppose 4 packets of a message, each of L bits arrive at a switch (router) and traverse a link with rate R bps to the destination. Further, suppose that the link is free when the first packet arrives, and the ...

According to the same national collegiate athletic

According to the same National Collegiate Athletic Association data, the means and standard deviations of eligibility and retention rates (based on a 1,000-point scale) for the 2013-2014 academic year are presented, alon ...

The system development team at the xyz company is working

The system development team at the XYZ Company is working on developing a new customer order entry system. In the process of designing the new system, the team has identified the following data entity attributes: Invento ...

The decomposition of so2cl2 is first order in so2cl2 and

The Decomposition of SO2Cl2 is first order in SO2Cl2 and has a rate constant of 1.42*10-4s-1 at a certain temperature. What is the half-life for this reaction?

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As