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
ladessa [460]
3 years ago
8

Ask the user for a total food bill and then find the new total after 6% tax and a tip of the users choice (15, 18, 20%) in pytho

n.
Computers and Technology
1 answer:
chubhunter [2.5K]3 years ago
3 0

Answer:

#here is code in python.

# read the food bill

tot_bill=float(input("Please enter the food bill:"))

# tax on food

tax=0.06

#choice for tip by user

choice=int(input("enter your choice for tip:(1 for 15%, 2 for 18% and 3 for 20% :)"))

// calculate the total food bill

if choice==1:

   tot_food_bill=tot_bill+tot_bill*tax+tot_bill*(.15)

elif choice==2:

   tot_food_bill=tot_bill+tot_bill*tax+tot_bill*(.18)

elif choice==3:

   tot_food_bill=tot_bill+tot_bill*tax+tot_bill*(.2)

else:

   print("invalid choice:")

#print the total food bill

print("total food bill is ",tot_food_bill)    

Explanation:

Read the food bill from user and assign it to variable "tot_bill".Initialize the tax=0.06 (i.e. 6%) on the bill.Then ask user to give his choice for tip. if the choice is 1 then tip will be 15%, if 2 then 18% and if choice is 3 Then tip will be 20% of the bill.Calculate the total food bill and assign it to variable "tot_food_bill".

Output:

Please enter the food bill:100                                                                                                                                

enter your choice for tip:(1 for 15%, 2 for 18% and 3 for 20% :)2                                                                                            

total food bill is  124.0

You might be interested in
What's a big question or problem in the tech field you'd like to solve and why?
aleksandrvk [35]

A big question or problem in the tech field that i would like to solve is Data security.

<h3>What is Data security ?</h3>

Data security  can be regarded as process of protecting data from unauthorized user as well as protection from  data corruption .

I will like to solve this problem because as advances in technology, the data of individual or organization is not been total secured and this is posing so much loss to individuals.

Data security are;

  • data encryption
  • hashing
  • tokenization

Learn more about Data security at;

brainly.com/question/17493537

5 0
2 years ago
Thomas owns a small Web services company and currently owns and maintains all his own computing hardware. He plans to develop an
Stels [109]

Answer: Hello the options related to your question is missing attached below are the options

answer : unlimited computing capacity for a low monthly fee ( A )

Explanation:

Since Thomas plans to develop a new service that will require his computing capacity to either double or triple, The best way of transitioning to the public cloud that might help Thomas meet up the requirement is Using unlimited computing capacity for a low monthly fee

7 0
2 years ago
A method countDigits(int num) of class Digits returns the remainder when the input argument num(num &gt; 0) is divided by the nu
sertanlavr [38]

Answer:

#include <iostream>

using namespace std;

class Digits

{

   public:

   int num;

   int read()       //method to read num from user

   {

       cout<<"Enter number(>0)\n";

       cin>>num;

       return num;

   }

   int digit_count(int num)  //method to count number of digits of num

   {

       int count=0;

       while(num>0)    //loop till num>0

       {

           num/=10;

           count++;   //counter which counts number of digits

       }

       return count;

   }

   int countDigits(int num)   //method to return remainder

   {

       int c=digit_count(num); //calls method inside method

       return num%c;  

   }

};

int main()

{

   Digits d;    //object of class Digits is created

   int number=d.read();   //num is read from user

   cout<<"\nRemainder is : "<<d.countDigits(number);  //used to find remainder

   return 0;

}

Output :

Enter number(>0)

343

Remainder is : 1

Explanation:

As program is missing to find errors , a logically write program is written to find the remainder when a number is divided by its number of digits. A class  Digits is constructed which has public variable num and methods read(), digit_count(), countDigits().

  • read() - This method reads value of num from the user and return num.
  • digit_count() - This method takes a integer as parameter and counts the number of digits of a number passed as argument. while loop is used to increement the counter until num<0. This returns the value of count.
  • countDigits() - This method takes a integer as a parameter and returns remainder when the argument is divided by number of  digits of argument. Number of digits is calculated by using method digit_count().

At last in main method , object of Digits class is created and its methods are used to find the output.

7 0
3 years ago
(photoshop cc)
iren2701 [21]
Black Point<span> Compensation option </span>controls whether to adjust for differences in black points when converting<span> colors </span>between color spaces<span>.

A is the answer :)

</span>
5 0
3 years ago
true or false : The incorrect attitude towards driving is the cause of most collisions among teenage drivers.
natulia [17]
That is true your state of mind is what matters most 

4 0
2 years ago
Read 2 more answers
Other questions:
  • Can you please answer these questions for me: Is it illegal to copyright? What does it mean to get copyrighted? What are example
    12·2 answers
  • A computerized spreadsheet program is useful for
    6·2 answers
  • The function known as "Comments" can be displayed during a presentation<br>O True<br>False​
    5·2 answers
  • What is SEO and SEM?
    10·1 answer
  • Login
    11·1 answer
  • What mistake might you make related to changing the data in a cell that's used in a formula?
    14·1 answer
  • What is the difference between coding with html and coding with python
    10·1 answer
  • Suppose we want to select between two prediction models M1 and M2. We have performed 10-fold cross validation on each. The error
    14·1 answer
  • How would a barcode reader be used in a healthcare industry?​
    6·1 answer
  • Greenpeace used "Mister Splashy Pants" to:
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!