1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Reptile [31]
3 years ago
12

Create a program that calculates three options for an appropriate tip to leave after a meal at a restaurant.

Computers and Technology
1 answer:
max2010maxim [7]3 years ago
7 0

Complete Question:

Python Programming: Create a program that calculates three options for an appropriate tip to leave after a meal at a restaurant and repeats if the user enters "y" or "Y" to continue.

Print the name of the application "Tip Calculator"

- Get input from the user for "Cost of meal: "

- Calculate and display the "Tip Amount" and "Total Amount" at a tip_percent of 15%, 20%, and 25%.

- Use a FOR loop to iterate through the tip_percent

- The formula for calculating the tip amount is: tip = cost of meal * (tip percent / 100)

- The program should accept decimal entries like 52.31. Assume the user will enter valid data.

- The program should round the results to a maximum of two decimal places . At the "Continue? (y/n)" prompt, the program should continue only if the user enters “y” or “Y” to continue.

- Print "Bye!" or a salutation at the end of the program

Answer:

Answered in Python

print("Tip Calculator")

tryagain = "y"

while tryagain == "y" or tryagain == "Y":

    amount = float(input("Cost of Meal: "))

    for tip_percent in range(15,26,5):

         print(str(tip_percent)+"%")

         print("Tip Amount: "+str(round(tip_percent * amount/100,2)))

         print("Total Amount: "+str(round(amount + (tip_percent * amount/100),2)))

    tryagain = input("Continue?y/n: ")

print("Bye!")

Explanation:

This prints the name of the calculator

print("Tip Calculator")

This initializes tryagain to yes

tryagain = "y"

While tryagain is yes, the following loop is repeated

while tryagain == "y" or tryagain == "Y":

This prompts user for amount of meal

    amount = float(input("Cost of Meal: "))

This gets the tip_percent which is 15%, 20% and 25% respectively

    for tip_percent in range(15,26,5):

This prints the tip_percent

         print(str(tip_percent)+"%")

This calculates and prints the tip amount rounded to 2 decimal places

         print("Tip Amount: "+str(round(tip_percent * amount/100,2)))

This calculates and prints the total amount rounded to 2 decimal places

         print("Total Amount: "+str(round(amount + (tip_percent * amount/100),2)))

This prompts user to continue or not

    tryagain = input("Continue?y/n: ")

The program ends here

print("Bye!")

You might be interested in
....................................................
labwork [276]

Answer:

.........................................................

Explanation:

8 0
3 years ago
What does a mother board in a computer do?
IRINA_888 [86]

The motherboard is the central component of a computer. Without it, the computer would not work. The mother board is sometimes called "the heart of the computer" because it allows thinks to function properly.

The motherboard of the computer is the part that holds the system memory and audio. It's a printed circuit board.

4 0
3 years ago
Write a program having a concrete subclass that inherits three abstract methods from a superclass. Provide the following three i
hammer [34]

Answer:

C++

Explanation:

using namespace std;

class AbstractClass {

public:  

   virtual bool checkUpperCase(string inputString);

   virtual string lowerToUppercase(string inputString);

   virtual void stringToInt(string inputString);

};

class ConcreteClass: public AbstractClass {

public:

   bool checkUpperCase(string inputString) {

       bool isUpper = false;

       for (int i=0; i < strlen(inputString);  i++) {

           if (isupper(inputString[i])) {

               isUpper = true;

               break;

           }

       return isUpper;

      }

   string lowerToUppercase(string inputString) {

       for (int i=0; i < strlen(inputString);  i++) {

           putchar(toupper(inputString[i]));

       }

       return inputString;

   }

   void stringToInt(string inputString) {

       int convertedInteger = stoi(inputString);

       convertedInteger+=10;

       cout<<convertedInteger<<endl;

   }

};

int main() {

   ConcreteClass cc;

   return 0;

}

3 0
3 years ago
How does an employer judge a candidate ​
vaieri [72.5K]
Test the candidate
Assess for practical experience
Determine strengths needed for the position.
6 0
4 years ago
Can someone write this in java? Also, does anyone know how to do Edhesive assignments?
svetoff [14.1K]
No I don’t know what are you saying can you explain or I’m here for points heheheh and Java is written in any way
7 0
3 years ago
Other questions:
  • 3.A customer has a system with a Gigabyte B450 Aorus Pro motherboard. He wants to upgrade the processor from the AMD Athlon X4 9
    11·1 answer
  • When a piston has three rings, the bottom ring will be?
    9·1 answer
  • In a set associative cache memory, if the number of ways (lines) in a set is doubled while keeping the cache size and line size
    13·1 answer
  • Which of the following is NOT a unit used to measure temperature?
    13·1 answer
  • Write a recursive method int power(int i, int j which determines teh result of i^j where j&gt;=0
    6·1 answer
  • Which of the following statements is true?A)Implicit data type conversion is performed when you mix values of different data typ
    5·1 answer
  • What is essence of computer systems and networks?​
    9·1 answer
  • Algorithms can be created in all the following ways EXCEPT:
    10·1 answer
  • Jim is working on a network design for a small office running a Windows file and printer server with Internet
    15·1 answer
  • Your friend Aria is complaining that programming seems too complicated. She says, “Why do we need things like sequence, selectio
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!