Retired

Can Mike eat his Sausage Rolls? (retired)

Description:

Mike went to buy some Sausage Rolls from the local supermarket, he did not realise that these Sausages Rolls all go out the next day!
Mike must eat as many Sausage Roles as he can before midnight (00:00). Your task is to work out how many Sausage Rolls he is not able to eat.

You will be given 3 inputs:
Bought: The number of Sausage Rolls Mike bought origionally
Time: The current time (Hours : Minutes) as a String
Rate: How many Sausage Rolls per Minute can Mike eat (He's a very good eater)

Example: Bought = 2000, Time = "18:20", Rate: 0.5

There are 5 Hours and 40 Minutes left until 00:00 - This is 340 Minutes
Eating 0.5 Rolls per minute will mean he eats 170 rolls

After this disappointing effort, there are 1830 rolls wasted.

A few things to note:
If he is part way through a roll as the clock strikes midnight, we will count that as wasted as he has not managed to eat the hole thing.
The day starts at 00:01 and ends at 00:00

Fundamentals

Similar Kata:

More By Author:

Check out these other kata created by Toby-D-Smith

Stats:

CreatedDec 17, 2021
Warriors Trained79
Total Skips18
Total Code Submissions76
Total Times Completed37
JavaScript Completions37
Total Stars0
% of votes with a positive feedback rating60% of 20
Total "Very Satisfied" Votes10
Total "Somewhat Satisfied" Votes4
Total "Not Satisfied" Votes6
Total Rank Assessments22
Average Assessed Rank
7 kyu
Highest Assessed Rank
7 kyu
Lowest Assessed Rank
8 kyu
Ad
Contributors
  • Toby-D-Smith Avatar
Ad