Would you like to inspect the original subtitles? These are the user uploaded subtitles that are being translated:
1
00:00:00,470 --> 00:00:08,270
What is going on, guys, so another amazing exercise in our programming course and in this exercise,
2
00:00:08,270 --> 00:00:15,910
what we are going to do is simply to write a program that receives an integer that represents seconds.
3
00:00:15,920 --> 00:00:23,450
OK, very similar to one of our previous exercises, I think in the previous chapter, in the previous
4
00:00:23,450 --> 00:00:25,250
section, we also use that.
5
00:00:25,550 --> 00:00:33,020
But here we will make some upgrades in some editions with probably using the conditions.
6
00:00:33,020 --> 00:00:33,440
Right.
7
00:00:34,320 --> 00:00:41,640
So write the program that receives an integer representing seconds, and the program should convert
8
00:00:41,640 --> 00:00:48,410
the given seconds into, first of all, total hours, total minutes and remaining seconds.
9
00:00:49,020 --> 00:00:58,740
And one important thing about this exercise is that your program should print the result in the following
10
00:00:58,740 --> 00:00:59,400
format.
11
00:00:59,760 --> 00:01:06,570
So that's the main main idea behind it, to print it in the following format and not like just like
12
00:01:06,570 --> 00:01:07,800
we've done it previously.
13
00:01:07,830 --> 00:01:14,990
We found the hours, the minutes and the seconds just by converting the main seconds that we received.
14
00:01:15,300 --> 00:01:18,960
But here we will need to print the result in this format.
15
00:01:18,960 --> 00:01:25,890
So hours, minutes and seconds, we will need to print it like these nice little clocks, if you remember,
16
00:01:26,280 --> 00:01:28,230
or maybe some of you still have them.
17
00:01:28,890 --> 00:01:30,740
So that's how we should print it.
18
00:01:31,500 --> 00:01:39,330
And although it seems to be pretty easy and pretty straightforward, there are a couple of notes here
19
00:01:39,330 --> 00:01:40,530
that let's talk about them.
20
00:01:40,530 --> 00:01:42,510
Let's just see this nice example.
21
00:01:42,520 --> 00:01:44,970
So seconds, for example, is for a thousand.
22
00:01:45,270 --> 00:01:47,220
Then we know how to receive ours.
23
00:01:47,220 --> 00:01:53,890
We know how to receive minutes, and we also know how can we retrieve the remaining seconds out of it.
24
00:01:53,910 --> 00:01:57,870
We talked about it in one of our previous exercises.
25
00:01:57,870 --> 00:01:59,880
It was very similar to this one.
26
00:02:00,270 --> 00:02:08,460
You just accept that now we are going to use this information to print all the time in these following
27
00:02:08,460 --> 00:02:08,870
format.
28
00:02:08,880 --> 00:02:13,020
So the final result should be zero one zero six forty.
29
00:02:13,440 --> 00:02:18,840
And one of the things that you need to understand is if, for example, the number of hours was like,
30
00:02:18,840 --> 00:02:21,420
I don't know, 11, there is no problem.
31
00:02:21,420 --> 00:02:23,420
We should simply print the hours.
32
00:02:23,790 --> 00:02:27,570
But what happens if the hours is less than 10?
33
00:02:27,600 --> 00:02:34,560
Then we still need somehow to print this zero before the one in this zero before the six.
34
00:02:34,720 --> 00:02:39,240
OK, so that's the whole idea about this exercise.
35
00:02:39,270 --> 00:02:43,410
So the printed result should not be one six forty.
36
00:02:43,410 --> 00:02:50,400
It should be zero one because do let's say two places, two digits for the hours, digits for the minutes
37
00:02:50,400 --> 00:02:52,380
and do the jets for the seconds.
38
00:02:52,570 --> 00:02:55,540
That's what we are going to to use.
39
00:02:55,980 --> 00:03:02,220
So basically in this exercise, the arrangement of the zeroes here matter.
40
00:03:02,280 --> 00:03:10,050
OK, so that's basically what I have to tell you as part of the requirements for this exercise.
41
00:03:10,380 --> 00:03:11,220
Take your time.
42
00:03:11,220 --> 00:03:16,260
Think about it, how you should tackle it, how we should solve it, and how basically you should print
43
00:03:16,590 --> 00:03:20,750
every value that you will receive in the following format.
44
00:03:21,570 --> 00:03:24,640
So until next time, I will see you in the Solutions video.
45
00:03:24,870 --> 00:03:26,550
This is Alphatech by.
4492
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.