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
BaLLatris [955]
3 years ago
5

The program asks the user to enter the time the call is made (day, evening, or night) and the duration of the call (a number tha

t can have one digit to the right of the decimal point). If the duration of the call is not an integer, the program rounds up the duration to the next integer. The program then displays the cost of the call. Run the program three times for the following calls: (a) 8.3 min at 1:32 P.M. (b) 34.5 min at 8:00 P.M. (c) 29.6 min at 1:00 A.M.
Computers and Technology
1 answer:
MakcuM [25]3 years ago
4 0

Answer:

The solution code is written in Python 3

  1. time_input = input("Enter calling time: (Please enter hour followed with minutes e.g. 14 30): ")
  2. duration = float(input("Please input duration of call: "))
  3. time_list = time_input.split(" ")
  4. hour, minutes = int(time_list[0]), int(time_list[1])  
  5. COST_PER_MIN = 0.2
  6. duration = round(duration)
  7. cost = duration * COST_PER_MIN  
  8. if(hour > 12):
  9.    hour = hour % 12  
  10.    print("Calling time: " + str(hour) + ":" + str(minutes) + " PM"  + " Cost: $" + str(cost)  )
  11. else:
  12.    print("Calling time: " + str(hour) + ":" + str(minutes) + " AM" + " Cost: $" + str(cost)  )

Explanation:

Firstly, we use input function to get the time and duration input (Line 1 -2). The time input is taken as a string and then we use split method to convert it into individual time component, hour and minutes (Line 4-5).

Presume the cost per minutes is $0.2 (Line 7) and we use the round function to round up the duration to the next integer (Line 8). Next, we apply formula to calculate the total cost of calling (Line 9)

We create if-else statement to check if hour larger than 12, then we print the calling time in PM and then display the cost, else the calling time is printed as AM (Line 11 -15).

You might be interested in
What is the term that is used to describe a computer system that could store literary documents, link them according to logical
LiRa [457]

Answer:

Hypertext

Explanation:

Based on the information provided within the question it can be said that the term that is being described is called Hypertext. This is an integrated software function that is found in many operating systems which allows the user to link different text and documents together for immediate access when the documents are logically related to one another.

3 0
3 years ago
GIVING BRAINLIEST What does output allow a computer to do? Display information Receive information Do complex math problems Do m
kumpel [21]
The answer is display information
4 0
3 years ago
Read 2 more answers
An authenticated user can add up to how many computer accounts to the domain, by default
Brums [2.3K]
By default, 10 computers can be joined to the domain by both users and administrators. As long as a user is authenticated against the Active Directory, he or she can add up to 10 computers to the domain.
While this one posses as an advantage for smaller companies, it is not a desirable feature for bigger companies since they have to control more tightly who can add machines to their domain.
7 0
4 years ago
Configuring a firewall to ignore all incoming packets that request access to a specific port is known as ____.
Sati [7]

Answer: Logical Point Blocking

Explanation:

4 0
1 year ago
PLEASE HELP ME
alexira [117]

Answer:

it won't be able to run

Explanation:

because computer runs on physical memory

5 0
3 years ago
Other questions:
  • How many degrees of freedom does any unconstrained object have in 3-D modeling?
    6·1 answer
  • Someone may choose to own a car instead of leasing because:
    14·2 answers
  • what are the products of light-dependent reactions? Why are they important in lighy independent reactions?​
    6·2 answers
  • In social networking websites such as twitter, people leave narrow minded and subjective remarks and upload unacceptable videos.
    9·1 answer
  • A(n) _____ is a computer network that uses Internet Protocol technology to share information, operational systems, or computing
    14·1 answer
  • Does any body know the name of this sensor? ​
    11·1 answer
  • Which of the following is true of a procedure? Check all that apply.
    10·2 answers
  • Quick please, URGENT
    12·1 answer
  • Write a paragraph on 'Save Earth Save Life.'​
    12·1 answer
  • The while loop and the do loop are equivalent in their expressive power; in other words, you can rewrite a while loop using a do
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!