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
shtirl [24]
2 years ago
5

Create a program that calculates the tip and total for a meal at a restaurant. Type the code into an IDLE IDE editor window and

save the finished code as a .py source code file. Remember that the text output from the IDLE shell window will be saved to a Word document.
Computers and Technology
1 answer:
Nataly [62]2 years ago
4 0

Missing details:

The formula for calculating the tip amount is:

tip = cost of meal * (tip percent / 100)

  • The program should accept decimal entries like 52.31 and 15.5.
  • Assume the user will enter valid data.
  • The program should round the results to a maximum of two decimal places.

Answer:

In Python:

print("Tip Calculator")

cost_meal =  float(input("Enter Cost of Meal: "))

tip_percent = float(input("Enter Tip Percent: "))

tip_amount = cost_meal * tip_percent / 100

total_amount = tip_amount + cost_meal

print("Tip amount:   "+str(round(tip_amount,2)))

print("Total amount:   "+str(round(total_amount,2)))  

Explanation:

This line prints the string "Tip "Calculator"

print("Tip Calculator")

This lime prompts user for cost of meal

cost_meal =  float(input("Enter Cost of Meal: "))

This lime prompts user for tip percemtage

tip_percent = float(input("Enter Tip Percent: "))

This line calculates the tip amount

tip_amount = cost_meal * tip_percent / 100

This line calculates the total amount

total_amount = tip_amount + cost_meal

This line prints the tip amount

print("Tip amount:   "+str(round(tip_amount,2)))

This line prints the total amount

print("Total amount:   "+str(round(total_amount,2)))  

Follow these steps to complete the solution

  • <em>Copy the code in the answer section.</em>
  • <em>Save as .py</em>
  • <em>Run the program</em>
  • <em>Save the screenshots of the program result in a word document</em>
You might be interested in
Which of the following was the name of the first generation of cell phone networks?
coldgirl [10]

Answer:

1G

Explanation:

1 'G' as in first generation.

Hope this helped. :)

3 0
3 years ago
4. In this problem, we consider sending real-time voice from Host A to Host B over a packet-switchednetwork (VoIP). Host A conve
mina [271]

Answer:

The time elapsed is 0.017224 s

Solution:

As per the question:

Analog signal to digital bit stream conversion by Host A =64 kbps

Byte packets obtained by Host A = 56 bytes

Rate of transmission = 2 Mbps

Propagation delay = 10 ms = 0.01 s

Now,

Considering the packets' first bit, as its transmission is only after the generation of all the bits in the packet.

Time taken to generate and convert all the bits into digital signal is given by;

t = \frac{Total\ No.\ of\ packets}{A/D\ bit\ stream\ conversion}

t = \frac{56\times 8}{64\times 10^{3}}          (Since, 1 byte = 8 bits)

t = 7 ms = 0.007 s

Time Required for transmission of the packet, t':

t' = \frac{Total\ No.\ of\ packets}{Transmission\ rate}

t' = \frac{56\times 8}{2\times 10^{6}} = 2.24\times 10^{- 4} s

Now, the time elapse between the bit creation and its decoding is given by:

t + t'  + propagation delay= 0.007 + 2.24\times 10^{- 4} s + 0.01= 0.017224 s

8 0
2 years ago
When formatting numbers with the Comma Number Format tool, the numbers are formatted with _________.
irina [24]

Answer:

2 decimal places

Explanation:

5 0
2 years ago
What type of cable is used to connect a workstation serial port to a cisco router console port?
butalik [34]

a <span>Ethernet-<span>Cable is a how to put it together</span></span>

<span><span /></span>

6 0
3 years ago
Look at the following assignment statements:
ziro4ka [17]

Answer: number 2 is the correct way to do it

Explanation:

3 0
2 years ago
Other questions:
  • Declaring single arrays is done with a0 set(s) of straight brackets.
    10·1 answer
  • A ____ is any key that uniquely identifies each row.
    15·1 answer
  • Write a program that asks the user to enter the amount s/he has budgeted for a month. The amount should be between 1000 and 2000
    11·1 answer
  • By Carl Sandburg
    6·1 answer
  • Bobbi owns a protein shake company, which has been trading for 3 years. Her products are stocked in a number of gyms, but the co
    11·1 answer
  • How can an administrator make only the files and folders to which a user has at least Read permissions visible?
    13·1 answer
  • #Write a function called alter_list. alter_list should have#two parameters: a list of strings and a list of integers.##The list
    11·1 answer
  • What should you include in a persuasive speech
    14·1 answer
  • Wesley purchased a word-processing software program. He used it for a year, during which he got regular updates every two months
    9·1 answer
  • If you use a new HTML5 input type (such as "range" or "number") on an older browser,
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!