Exception handling to a tip calculator program

Assignment Help Basic Computer Science
Reference no: EM131934326

Add exception handling to a Tip Calculator program. 

Console

Tip Calculator

INPUT

Cost of meal: ten

Must be a valid decimal number. Please try again.

Cost of meal: -10

Must be greater than 0. Please try again.

Cost of meal: 52.31

Tip percent: 17.5

Must be a valid integer. Please try again.

Tip percent: 20

OUTPUT

Cost of meal: 52.31

Tip percent: 20%

Tip amount: 10.46

Total amount: 62.77

Specifications

  • The program should accept decimal entries like 52.31 and 15.5 for the cost of the meal.
  • The program should accept integer entries like 15, 20, 25 for the tip percent.
  • The program should validate both user entries. That way, the user can't crash the program by entering invalid data.
  • The program should only accept numbers that are greater than 0.
  • The program should round results to a maximum of two decimal places.

This program need to run with python

Reference no: EM131934326

Questions Cloud

Important in the electronic communications : How is bandwidth defined, and why it is so important in the electronic communications?
Analyze how the company will capture value : The purpose of the assignment is for students to establish long-term goals and objectives; indicate, specify and discuss strategies; and investigate.
Discuss the occupational safety and health act : Considering the guidelines for employers under the Occupational Safety and Health Act of 1970, what do you feel will be important to include in your.
Symptoms and medical histories into a computer : DQ 1. What pros and cons could result from patients entering their own symptoms and medical histories into a computer?
Exception handling to a tip calculator program : The program should accept decimal entries like 52.31 and 15.5 for the cost of the meal. The program should accept integer entries like 15, 20, 25.
Develop sample leave policy presented to the company owner : Develop a sample leave policy to be presented to the company owner. Be sure that the policy covers the key components of a comprehensive leave policy.
Explain how do the texts relate to larger themes and topics : Explain How do these texts relate to larger themes and topics of the course? and What questions do these texts bring up for you?
What does a succession plan do : What competencies are needed in leaders for your organization and how do you proposed to develop those competencies in potential leaders?
Write report that evaluates an organisation people practices : MBA401 People, culture and contemporary leadership Assessment Report. Write a report that evaluates an organisation's people practices

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Identifies the cost of computer

identifies the cost of computer components to configure a computer system (including all peripheral devices where needed) for use in one of the following four situations:

  Input devices

Compare how the gestures data is generated and represented for interpretation in each of the following input devices. In your comparison, consider the data formats (radio waves, electrical signal, sound, etc.), device drivers, operating systems suppo..

  Cores on computer systems

Assignment : Cores on Computer Systems:  Differentiate between multiprocessor systems and many-core systems in terms of power efficiency, cost benefit analysis, instructions processing efficiency, and packaging form factors.

  Prepare an annual budget in an excel spreadsheet

Prepare working solutions in Excel that will manage the annual budget

  Write a research paper in relation to a software design

Research paper in relation to a Software Design related topic

  Describe the forest, domain, ou, and trust configuration

Describe the forest, domain, OU, and trust configuration for Bluesky. Include a chart or diagram of the current configuration. Currently Bluesky has a single domain and default OU structure.

  Construct a truth table for the boolean expression

Construct a truth table for the Boolean expressions ABC + A'B'C' ABC + AB'C' + A'B'C' A(BC' + B'C)

  Evaluate the cost of materials

Evaluate the cost of materials

  The marie simulator

Depending on how comfortable you are with using the MARIE simulator after reading

  What is the main advantage of using master pages

What is the main advantage of using master pages. Explain the purpose and advantage of using styles.

  Describe the three fundamental models of distributed systems

Explain the two approaches to packet delivery by the network layer in Distributed Systems. Describe the three fundamental models of Distributed Systems

  Distinguish between caching and buffering

Distinguish between caching and buffering The failure model defines the ways in which failure may occur in order to provide an understanding of the effects of failure. Give one type of failure with a brief description of the failure

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