WEBVTT

0
00:00.650 --> 00:01.310
Hey there.

1
00:01.310 --> 00:05.180
Welcome to Day 10 of 100 Days of Code.

2
00:05.180 --> 00:09.650
And today we're going to learn about functions with outputs.

3
00:09.650 --> 00:16.610
Previously we've already seen the other two flavors of functions a plain function and also functions

4
00:16.610 --> 00:17.750
with inputs.

5
00:17.750 --> 00:23.270
But in today's lessons we're going to be using the skills that we've learned, and we're going to be

6
00:23.270 --> 00:27.530
extending our knowledge of functions to build a calculator app.

7
00:27.950 --> 00:33.230
I think at some point in every programmers lives they will have built a calculator app.

8
00:33.230 --> 00:38.870
So if that hasn't already happened to you, then today is your lucky day because that's exactly what

9
00:38.870 --> 00:40.010
we're going to be making.

10
00:40.010 --> 00:47.840
So it's a simple text based calculator, and we can start off by writing a number, and then picking one

11
00:47.840 --> 00:51.050
of the operations, plus, minus, multiply, or divide.

12
00:51.050 --> 00:53.600
So I'm going to divide this by two.

13
00:53.600 --> 00:58.550
And then it shows us the full calculation of 5 / 2 = 2.5.

14
00:58.550 --> 01:02.900
And now we can continue calculating with the answer from the previous step,

15
01:02.900 --> 01:05.830
or we can type n to start a new calculation.

16
01:05.830 --> 01:12.400
Let me type y and maybe I'll do 2.5 + 6,

17
01:12.640 --> 01:14.770
and now I get 8.5.

18
01:14.770 --> 01:21.250
By the end of the lessons today, you will have understood how functions really work, how you can use

19
01:21.250 --> 01:29.380
them to reduce redundant code, and how you can provide inputs to functions as well as providing outputs.

20
01:29.560 --> 01:33.820
Once you're ready, head over to the next lesson and let's get started.