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
Peter is a data analyst in a financial firm. He maintains a spreadsheet that contains all employee details. Peter wants to analy
alukav5142 [94]

Answer: filter the data of employees with more than five years of experience

Explanation:

The technique that Peter can use to perform this analysis is to filter the data of employees with more than five years of experience.

Filter in spreadsheets allows one to see the data that is required based on the input that was given. In this case, since Peter wants to analyze the data of all employees that have experience of more than five years, this can be filtered and the employees who have experience of more than 5 years will be shown.

The workers who have experience of less than five years will not b shown in this case.

3 0
3 years ago
______ have become a common and easily created form of malware that are creating using applications such as Visual Basic or VBSc
Helen [10]

Answer:

Macro Viruses

Explanation:

Macro Viruses have become a common and easily created form of malware that are creating using applications such as Visual Basic or VBScript.

7 0
3 years ago
a key part of staying safe is employing good habits. drag the step number to the proper sequence triple a
solong [7]

Answer:

where are the step number. I can't find any

6 0
3 years ago
How do you post a picture on brainly? How do you also lower the points to like 5,brainless to the first understandable answers
Morgarella [4.7K]
To post a picture you just need to click on the clipper looking thing 
3 0
3 years ago
Your company is experiencing an increase in malware incidents. Your manager is asking for advice on how best to verify that comp
dexar [7]

Answer:

c.

Explanation:

Based on the information provided within the question it can be said that the best option in this scenario would be to implement an endpoint management server appliance. This is a software or dedicated appliance that is used in order to discover, manage, and control any and all computer devices that are trying to access the corporate network. This allows you to remove individuals as well as administrative rights from those trying to connect or that are already connected.

5 0
4 years ago
Other questions:
  • Cleaning the keyboard is the most important part of keeping your computer running at peak performance.
    5·2 answers
  • If you need to add more data between column C and column D, you should _____.
    7·1 answer
  • "______" is a wireless local network that uses high frequency radio signals to transmit an Internet signal from a wireless route
    9·1 answer
  • What do reservations do?
    15·1 answer
  • To build a framework for security policies and controls, one can use the following approach: 1) document the concepts and princi
    12·1 answer
  • What will be the result of running the following code fragment? int year = 0; double rate = 5; double principal = 10000; double
    14·1 answer
  • When a person devises the idea for the venture, develops a business plan, uses savings or loans to acquire other resources and a
    9·1 answer
  • Some programmers include scroll bars, title bars, buttons, and menus in a program simply by adding them to a layout through a pr
    10·1 answer
  • Custom Offers empower Sellers to upsell even higher than their Premium Packages—but when should a Custom Offer be used?
    12·1 answer
  • What are the two different types of dns requests?
    5·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!