Hello and welcome.
Welcome to another exciting lecture.
And in this lecture, it's going to be our first challenge.
So you remember from previous lectures I mentioned that I'm going to provide slides to you to help you
learn the concepts.
I'm also going to do demonstrations, which I've done both so far.
But in order for you guys to learn the material, you have to have some kind of self assessment.
And so I'm going to be giving you guys challenges, essentially homework assignments where you can complete
the homework assignments to see how well you're learning.
And so in this lecture, this is going to be your first challenge.
Very exciting.
Our first challenge, our first assignment, more or less.
And so what I'd like to describe to you is what the challenge is, what are the requirements and what
what this challenge is going to include is it's going to be writing your first program.
So what we're going to do is you're going to write a C program that displays your first name as output.
That's a requirements.
That's what I want you to do.
And so in order to complete this task and complete this challenge, you're going to need to do the following
things.
You're going to first have to create a project in code light, and I've demonstrated how you can do
that.
So you should be able to do that.
You're going to use the IDE to perform the tasks that you do in every C program, edit, compile and
run, and then test your code, right?
So the first step is creating that project.
You can use the lecture that I provided earlier if you if you need to go through those steps again as
part of creating a project, we know that it generates a file for you.
I don't want that file generated for you because it's going to do all the work for you.
So after you create the project, make sure you go into your project inside your project window, your
management window, and make sure you delete the main dot C file that was generated.
You can right click on it and say Remove.
After you've created your project, you then the next step would be to create a new C source file.
And we know that all C source files and in the dot C extension you should create the C source file in
the project that you created and you should name the source file test.
Once you've created the source file, then you're going to have to edit it.
You're going to have to actually put some code in there.
The code that you put in there is not important.
That's not what we're trying to learn in this phase.
What you're trying to learn is how to create a program and how to compile it and run it.
Writing the code doesn't matter right at this point.
So what I want you to do is I want you to copy the source code that I've provided right here.
And it looks a little weird, right?
You see this pound and then it says include and there's an int and it says Main and then there's these
squiggly brackets and all this.
None of that's really important.
Copy and paste this.
The line that is important is the printf and that's the line you're going to need to modify to display
your name.
But I've started it for you.
I said, Hi, my name is so copy and paste this code into your test.c file after you've copied and pasted
that code in this test dot c file, you're going to need to modify the line so that when the program
runs, it displays the right output.
And so you're going to need to modify that printf line.
Basically just add your name where the dots are, and that will be part of editing the source code.
After you successfully added the source code, then you want to compile and link it.
And this again was explained in another lecture, so this should be pretty straightforward.
There's menu options to build, so you want to compile and link and then you want to analyze the build
output window.
This step again is just going to your menu option and building.
And what this will do is it will issue the GCC command to compile and it will set the test C files in
an import and it will also generate any object files and then it will link all those object files to
create a program.
If you have any errors when you compile and link, you'll see them in the build window.
That means you'll have to go back and edit your source code to fix those errors.
Now, if you copied the source code exactly how it is on the slide, you'll be fine.
One of the things you're going to notice with programming is the detail matters.
Make sure you copy the source code exactly how it is.
Everything matters.
Okay, so if you're missing a semicolon or anything like that, it can cause your program not to compile.
Now, if you were successful in compiling and linking the source code, then you want to run the program,
you want to execute it.
And again, this is just another menu option in the in the IDE.
Once you run the program, it's going to it's going to actually display a new console.
It's going to display the dos prompt, that little black window.
And you need to analyze the output to confirm that it's correct.
If it doesn't display your name, then you're going to have to repeat this process.
You're going to have to go and edit the source code recompile, which will link and then run.
And this is the process that you're always going to employ when creating a program editing compiler,
linking and running, and then testing and debugging, testing the code, making sure it does what it's
supposed to do and if it doesn't, fixing the errors.
So this is your challenge.
I'm going to provide a solution to this in the next lecture, but go ahead and do this on your own.
Again, it's important to do it on your own so that you you learn from it.
All right.
Just watching the lecture, you might have missed some steps.
If you go and do this on your own, it's going to be like the back of your hand the next time you need
to write another program.
So good luck.
And and I hope you guys succeed.
Thank you.