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
When preparing to communicate a solution to a design problem, you must:?
damaskus [11]
You must Examine the viewpoint of ur audiences
7 0
3 years ago
. Write the advantages and disadvantages of CLI?
Sindrei [870]

\huge\mathcal\colorbox{blue}{{\color{red}{AnSwEr~↓~↓~}}}

\huge\mathbb\colorbox{black}{\color{white}{Advantages=}}

  • If you know the commands, a CLI can be a lot faster and efficient than any other type of interface. ...

  • A CLI requires less memory to use in comparison to other interfaces. ...

  • A CLI doesn't require Windows and a low-resolution monitor can be used.

\huge\mathbb\colorbox{black}{\color{white}{Disadvantages}}

  • Commands have to be typed precisely. If there is a spelling error the command will fail

\huge\mathbb\colorbox{Blue}{\color{red}{Hope \: It\: Help \: U}}

7 0
3 years ago
Read 2 more answers
A. which chip is thought to be the first microprocessor? how many transistors roughly did it use?
vaieri [72.5K]
A micro processor is an integrated circuit that have all the functions of a central processing unit of a computer.
The chip which is thought to be the first microprocessor is INTEL 4004. It was manufactured by Intel in 1971. Intel 4004 has 2,300 transistors. 
4 0
4 years ago
What can be controlled through IoT? Choose four answers.
Maru [420]

<em>The answer is: </em>

<em> </em>

<em>Door locks, light switches, security cameras and desktops (even laptops too) </em>

<em> </em>

<em>When we say Internet of Things, it is basically all objects that can be connected to internet (objects that are parts of our daily lives) can be included in this phrase or quote). There are technologies pertaining to common household items such as locks, switches and cameras that can be controlled through the use of phones and internet. These things collect and stores data such as names, fingerprints, pictures and scans that are used for verification and authentication purposes. </em>

<em> </em>

<em />

5 0
3 years ago
Binary numbers can be shifted left or right to alter their value.
Hoochie [10]
Maybe try “01110011”
6 0
3 years ago
Other questions:
  • A ________ is a container that provides quick access to elements at the front and the back of the list
    6·1 answer
  • Universal Containers has a bundle with many features. In one of these features, Feature A, all product options share the same Di
    5·1 answer
  • Based upon the contents of the BOOKS table, which line of the following SQL statement contains an error?
    13·1 answer
  • _____ are the most fundamental components of designing a training program that determine the amount of stress placed on the body
    6·1 answer
  • DNA structure can be described as a twisted ladder. Imagine you are climbing a model of DNA, just as if you were climbing a ladd
    10·2 answers
  • Задание: Построить иерархию классов в соответствии с вариантом задания. Построить диаграммы классов.
    8·1 answer
  • Define a function OutputValues() that takes two integer parameters and outputs all integers between the first and the second par
    15·1 answer
  • 26. Universal Containers (UC) has a queue that is used for managing tasks that need to be worked by the UC customer support team
    11·1 answer
  • A ____________________ machine is used to gather or arrange in their proper sequence.
    9·1 answer
  • The ________ networks operate close to the legitimate free hotspots and typically provide stronger signals
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!