A babysitter charges $2.50 an hour until 9:00 PM when the rate drops to$1.75 an hour (the children are in bed). Write a program that accepts astarting time and ending time in hours and minutes and calculates the totalbabysitting bill. You may assume that the starting and ending times are ina single 24-hour period. Partial hours should be appropriately prorated.

Answers

Answer 1
Answer:

Answer:

print("enter starting time hours")

st_hours=int(input()) #starting time hours

print("minutes")

st_minutes=int(input()) #starting time minutes

print("enter ending time hours")

et_hours=int(input()) #ending time hours

print("minutes")

et_minutes=int(input()) #ending time minutes

cost=2.50

if (st_hours<21 and et_hours>21): #if starting time is less than 21 and ending time is greater than 21

a_hours=et_hours-21

a_minutes=et_minutes #taking time after 21 from ending time ending time-21

time_minutes=60-st_minutes #converting all the time into minutes

time_hours=21-(st_hours+1)

time_hours=time_hours*60

time=time_hours+time_minutes

cost=(cost/60)*time

time=(a_hours*60)+a_minutes

cost=cost+(1.75/60)*time

print("cost=$",cost)

elif(st_hours>=21): #if starting time is greater than 21

time_hours=et_hours-(st_hours+1)

time_minutes=(60-st_minutes)+et_minutes #converting time into minutes

time=(time_hours*60)+time_minutes

cost=(1.75/60)*(time)

print("cost=$",cost)

elif(et_hours<=21): #if ending time is less than 21

time_hours=et_hours-(st_hours+1)

time_minutes=(60-st_minutes)+et_minutes

time=(time_hours*60)+time_minutes

cost=(2.50/60)*time

print("cost=$",cost)

Explanation:

This is a conditional program, the conditions applied are if and else if.

The resultant output was gotten using this three steps:

(1) If starting time is less than 21 and ending time is greater than 21

Then I converted the time into minutes before 21

ex:- 8:30

21-9= 12*60= 720 + 30 = 750

Then I calculated the bill.

750 * (2.50 / 60)

Then I converted the time after 21 and then calculated the bill and printed it.

(2)If starting time is greater than 21

Converted time into minutes and multiplied it with (1.75 / 60) to get the bill.

(3) If ending time is less than 21

Converted time into minutes and multiplied it with (2.50 / 60) to get the bill.

Please check attachment for program code screenshot.


Related Questions

The following JavaScript program is supposed to print: 1 by 4 by 9on a single line by itself. Unfortunately the program contains at least eight mistakes. Write the corrected line beside the line in error.var N; // TextN := 1;document.writeln( N );document.writeln( “ by “);document.writeln( “N + 3”);document.writeln( “ by “ );document.writeln( N + 5);
What is the history of telecommunication​
Write a function named minMax() that accepts three integers arguments from the keyboard and finds the smallest and largest integers. Include the function minMax() in a working program. Make sure your function is called from main().Test the function by passing various combinations of three integers to it.
Which of the following statements is true of recombinant batteries? A. They recombine oxygen.B. They're able to produce a higher voltage.C. They're vented to release gassing.D. They recombine sulfuric acid.
Write an application that calculates and displays the amount of money a user would have if his/her money could be invested at 5% interest for one year. Create a method that prompts the user for the starting value of the investment and returns it to the calling program. Call a separate method to do the calculation and return the result to be displayed. Save the program as Interest.java

Create a query that will list all technician names, employee numbers, and year hired in order by year hired (Newest to Oldest).

Answers

Answer:

SELECT TECHNAME, EMPNUM, YEAR FROM EMPLOYEE ORDER BY YEAR DESC

Explanation:

The table definition is not given;

However, I'll make the following assumptions

Table Name:

Employee

Columns:

Technician name will be represented with Techname

Employee number will be represented with Empnum

Year Hired will be represented with Year

Having said that; the sql code is as follows:

SELECT TECHNAME, EMPNUM, YEAR FROM EMPLOYEE ORDER BY YEAR DESC

The newest year hired will be the largest of the years;

Take for instance:

An employee hired in 2020 is new compared to an employee hired in 2019

This implies that the year has to be sorted in descending order to maintain the from newest to oldest.

One author states that Web-based software is more likely to take advantage of social networking (Web 2.0) approaches such as wikis and blogs. If this is the case, can we expect more social networking capabilities in all future software? Aside from LinkedIn, how can social media be leveraged by CIT graduates?

Answers

Answer:

Yes

Explanation:

I will say Yes. There are very much limitless possible and future we can expect from social media and even more from social networking. Its capabilities from upcoming software in the future. Since the Internet is in its early days of growing and cloud computing being introduced there are way more possibilities in the future.

Social media can be duely applied by CIT (Computer Information Technologies) graduates. It can be used to improve them in their career and also will helps them connect professionally. Quora is one such platform which is not exactly like LinkedIn but pretty much serves the purpose.

Explain how signal detection theory can be used to analyze web site reading and searching. Based on this analysis, provide three suggestions for your favorite search engine or web site that includes search.

Answers

Answer:

Human visual behavior often includes searching, scanning, and monitoring.

While it should be possible to moderate the performance of these tasks based on the dimensions used in the table, it is often useful to analyze these situations using Signal Detection Theory (SDT).              

 

Three suggestions for my favourite search engine that includes search are:

1.  ensure that search results are graded according to the following categories using different colours:  

  • Most accurate and relevant results;
  • Accurate and slightly relevant results
  • Fairly accurate and fairly relevant results

These can help the users identify more easily the results to spend more time on. This categorisation can be done using colours. This is because of the way the eye functions. Unlike a camera snapshot, for example, the eye does not capture everything in a scene equally, but selectively picks out salient objects and features from the current context, and focuses on them so they can be processed in more detail.

2.  Another suggestion is that attention needs to be paid to where people look most of the time. It is not out of place for people to instinctively avoid search results that have dollar signs or currency signs especially when they are not searching for a commercial item.  

3. Lastly in displaying results that have images, it best to use sharp images. The theory suggests with respect to contrast, clarity and brightness that sharper and more distinct objects appear to be nearer, and duller objects appear to be farther away. To elicit the interest of the reader, targeted results or information from search engines must make use of the factors of contrast, clarity and brightness.

Cheers!

   

A customer contacts the help disk stating a laptop does not remain charged for more than 30 minutes and will not charge more than 15%. Which of the following components are the MOST likely causes the issue? (Select three.)A. LCD power inverterB. AC adapterC. BatteryD. ProcessorE. VGA cardF. MotherboardG. Backlit keyboardH. Wireless antenna

Answers

Answer:

Option A, Option B, and Option C are the correct options.

Explanation:

The following options are correct because when any person is facing a problem related to its laptop and he wanted to contact with the customer service agent to solve his problem of the Laptop that is his Laptop battery does not work more than the half-hour and his Laptop's battery not charge more than 15%.

So, his laptop will be facing the problems related to Battery, LCD power inverter, or AC adapter.

What makes a computer a computer?​

Answers

Answer:

A computer is an electronic device that manipulates information, or data. It has the ability to store, retrieve, and process data. You may already know that you can use a computer to type documents, send email, play games, and browse the Web

Explanation:

Follow me..............

central processor unit (CPU)

memory (ram)

input (mouse keyboard)

output (monitor or printer)

browse the web

ability to store retrieve and process data

I don't rlly know much about technology but I hope this helps

Write a C++ program to find the number of pairs of integers in a given array of integers whose sum is equal to a specified number.

Answers

Answer:

int main()

{

   int A1= {5,3,4,8,9,0,7};

   int SArri1 = sizeof(A1);

  printf("Original array: ");

   

   for (int i=0; i < SArri1;i++)  

   printf("", A1[i] );

   

   int i, sum = 20, n= 0;

   printf("\nArray pairs whose sum equal to 20: ");

   

   for (int i=0; i<SArri1; i++)

       for (int j=i+1; j<SArri1; j++)

           if (A1[i]+A1[j] == sum)

             {

              Printf(“\n”, array1[i])

Printf(“,”,array1[j]);

               n++;

             }

 

  printf("\nNumber of pairs whose sum equal to 20: ",n)

   return 0;

}

Explanation:

First of all, you should create the array of integers, and put random numbers. Then you have to save in a constant the size of the array (in this  code is called SArr1) With a for you can print all the numbers that are on the array because then you will print all array pairs whose sum is equal to  a specified numer. in this code we are going to use 20.

then with a condition (if) you are going to compare one of number of the array with all the others and check if its equal to 20. If yes, it going to print the numbers that answer to that condition and it's going to add +1 to the variable n (for this you will need to use two bucles for)

Then you can print the number of pairs whose sum is equal to 20 by printing n