Course Introduction to Programming

Submit a solution

Course's Page 10 min Text by
User Image
Thiago Nepomuceno

In this lesson, we learn how to submit solutions for programming exercises here at Neps.

We will learn:

  • How a programming exercise looks like;
  • How to submit a solution.

During this course, you will encounter several programming exercises. At Neps you have the possibility to send your code to our platform, and we will evaluate it for you in real-time. That way, you'll be sure that you have really learned the content.

Let's take a look at the page of an exercise.

Figure 1

On this page, we can see a card with the title and description of the exercise on the left. On the sidebar on the right, we have another card with options. An exercise is always composed of a statement describing the task you have to perform, an input, which describes what will be the input data for your program, and an output, which describes exactly how your program has to print the answer on the screen.

The exercise in the picture above is a very simple exercise, where you don't have to read any input, and you just have to print the message "Ola Neps Academy!" on the screen.

The first step is to create a solution for our exercise. For this we will open our IDE, in the case of this course, we will use CodeBlocks. Then we will create a file by accessing File > New > New File as shown in the image below.

Figure 2

Then we have to save our file, just go to File > Save File and save the file we will work on. It is very important to save our file with the extension ".c ", because this indicates that we are writing code using the C language.

Figure 3

Now we will write our code as we learned in the last class, but this time we are going to print the phrase "Ola Neps Academy!

#include <stdio.h>

int main() {
    printf("Ola Neps Academy!");
}

To test our program, we click on the Build and run icon.

Figure 4

As a result, we will see the message on the screen.

Figure 5

It is very important that you print EXACTLY the way that is described in the exercise description. If you printed "Olรก Neps Academy!" or "Ola Neps Academy" your program would be wrong, because in the first example "Olรก" is being printed with accents while in the second example you forgot the ! sign.

Now that we have verified that our program does exactly what we want, just click on the Write solution button on the Neps page, select the C language (if you have more than one option available) and copy your code from CodeBlocks to Neps. Now just click on the Send button and wait for the result of the evaluation.

Figure 6

The Submission Status shows that our code is correct and has been accepted by Judge (the program that evaluates the codes ๐Ÿ˜ƒ).

After learning more about programming, you can attempt to solve more exercises directly from the exercises page.

That's it for now, until the next time! ๐Ÿ˜„