Basic programming course: Lesson #1 - Introduction to programming

in #devjr-s20w110 days ago

Lesson #1.png

Edited By Canva

Hello Steemit friends!

I am enthusiastically participating in this contest organized by the kind user @alejos7ven. It is a great opportunity to practice my programming skills while discovering new challenges. I am looking forward to sharing my knowledge and taking on the different tasks proposed with passion.

Task 1. Describe in your own words an algorithm of some activity you do daily.

The process of preparing a class as a teacher can be seen as a series of methodical steps (algorithm) that ensure the content is well-planned and organized for effective delivery. Each step aims to make sure that the lesson is ready and tailored to the students' needs, while also ensuring a smooth flow during the teaching. Here's a detailed description of how I approach this task.

Start
The algorithm begins with the decision to prepare the class. The goal is to ensure that all necessary steps are followed to deliver quality educational content to the students.

1. Check the schedule to see the topic of the day
The first step is to consult the schedule and any related course documents to determine the topic that needs to be covered in the next session. This is crucial to stay aligned with the semester's plan.

Example: "Today, I need to teach quicksort algorithm."

2. Gather resources (documents, slides, videos, etc.)
Once I identify the topic of the day, I gather all the necessary teaching materials. This includes slides, explanatory videos, reference articles, and any other resources that might enrich the lesson.

Example: Downloading a video explaining the quicksort algorithm or accessing practical exercises for the students to work on.

3. Prepare a lesson plan with introduction, development, and conclusion
Next, I structure the lesson into three main parts: the introduction, which presents the topic and grabs the students' attention; the development, where the topic is explained in detail; and finally, the conclusion, which summarizes the key points and opens the floor for questions or discussions.

Example: Introducing quicksort with real-life examples, then thoroughly explaining each step of the algorithm using visual aids, and concluding by reviewing the main points like the advantages and use cases of quicksort.

4. Check if exercises need to be prepared for the students
Once the lesson content is structured, I determine if any exercises or practical activities need to be prepared for the students. This could include quizzes, hands-on tasks, or case studies that allow students to apply what they've learned.

Example: Preparing exercises on implementing the quicksort algorithm in pseudocode or a specific programming language.

5. Finalize the preparation and review the content to ensure it's ready
Once everything is prepared, it's essential to review the materials. This includes checking for any errors, ensuring the explanations are clear, and verifying consistency across the lesson components. It's also important to ensure that all resources (e.g., code examples, slides) are functioning properly.

Example: Checking the exercises to ensure they are doable in class and that the slides are clear.

6. Go to class and deliver the lesson
The final step of the algorithm is the actual execution of the lesson. This involves going to the classroom, following the lesson plan, and adapting to students' reactions and needs. It may also require some improvisation to address unexpected questions or clarify concepts.

Example: Presenting the slides, interacting with students to answer their questions, and reviewing the exercises completed in class.

End
The algorithm concludes after delivering the lesson. However, I may also include an evaluation step by grading students' performance or gathering feedback to improve future sessions.

This well-structured algorithm reflects the entire process of preparing a class, from the initial planning to delivering the lesson in class, with review and adaptation of resources along the way.

Task 2. What is the importance of programming languages in the world? How do they help us?

Programming languages are fundamental in my role as an educator and in the broader world of technology. They provide a structured way for humans to communicate with machines allowing me to teach and systematically solve complex problems. By using programming languages, I can design software, applications and systems that not only automate repetitive tasks but also enhance decision-making processes through data analysis. In the educational setting, programming languages help students understand logical reasoning and problem-solving giving them tools to build real-world solutions.

In my daily work, I witness how programming languages drive innovation across multiple industries. In healthcare, they enable the development of diagnostic tools and data management systems. In industry, they allow for the automation of production processes and optimization of supply chains. In education, I use them to develop interactive learning platforms and simulation tools that make abstract concepts more tangible for students.

pseudo.jpg

Beyond their practical applications, programming languages are crucial for translating human ideas into machine-executable instructions. When I teach students, I emphasize how these languages serve as a bridge between conceptual thinking and real-world implementation. A simple algorithm or set of instructions in a programming language can result in a functioning application, a website or a complex system like an AI-driven tool.

Moreover, programming languages are essential for advancing research and development in areas like artificial intelligence, machine learning and data science. These fields rely on programming to process vast amounts of data, train models and simulate scenarios. Without programming languages, none of these advancements would be possible.

In short, programming languages are not just tools for writing code—they empower me and my students to think critically, solve problems and create innovative solutions that have a lasting impact across various sectors. They enable us to transform abstract concepts into working systems that making them indispensable in the modern world.

Task 3. What do you need while programming?

To program effectively, there are several essential elements that I need to ensure success in developing solutions.

First, it is essential to have a clear understanding of the problem I am trying to solve. Whether it is a complex algorithm or a simpler task, I need to understand the requirements and constraints in depth. This allows me to define the logic and structure of the program. Without this clarity, it is easy to get lost in unnecessary details or adopt inefficient approaches. For example, when I teach algorithms to my students, I make sure they understand the problem well before I start coding which helps them focus on the essentials.

Second, a suitable development environment (IDE or text editor) is crucial for writing, testing, and debugging the code. I often use integrated development environments like Visual Studio Code or PyCharm because they offer features such as code completion, syntax highlighting and built-in debugging tools. This makes the development process smoother and more efficient. For example, when I teach Python, I show my students how a good IDE can detect syntax errors quickly and allow them to fix them without having to run the program each time.

Having a solid understanding of algorithms and data structures is also essential. These concepts allow me to choose the most appropriate solutions to optimize the performance of my programs. They are essential for efficient memory management and problem solving. As a teacher, I emphasize the importance of mastering these concepts, because the choice of an appropriate algorithm or data structure can significantly influence the efficiency of a program. For example, to sort data, the choice between quicksort or mergesort depends on the specific constraints of the task.

I also rely on reference resources such as language documentation, libraries, or online forums. Even with experience, I regularly consult these resources to get clarification on specific features, methods, or alternative approaches. Platforms like Stack Overflow or GitHub are very useful for finding solutions to common problems or understanding best practices. When teaching a new language or framework, I encourage my students to familiarize themselves with the official documentation to learn the language's specificities and avoid bad coding habits.

Finally, patience and rigor are essential, especially for debugging. Errors are inevitable in programming, and the ability to methodically diagnose and fix them is an essential skill. I emphasize to my students the importance of a systematic approach to identifying and fixing bugs, as it leads to more robust solutions. For example, when I am faced with a bug I take care to review each line of code, test smaller parts of the program and use debugging tools to isolate the problem.

Task 4. Write your first "Hello world!" Using pseudo-code.

To write an algorithm, I start by defining a basic structure, which usually consists of the keywords Algorithm and EndAlgorithm. Everything I insert between these two keywords represents the instructions to execute.

In this example, I want to introduce myself by displaying the message "hello I am kouba". To do this, I use the Print command, followed by the message in quotes, and end with a semicolon (depending on the language).

Here is the algorithm in pseudocode:

Algorithm kouba01_task04
Print "hello I am kouba!";
EndAlgorithm

image.png

Now, I will translate this algorithm into five different programming languages: C, C++, Java, JavaScript, and Python.

1. In C

The C language requires the standard library to use the printf function. Here is the translation:

#include <stdio.h>

int main() {
printf("hello I am kouba!\n");
return 0;
}

2. In C++

In C++, we use iostream to display a message on the screen with cout.

#include <iostream>

int main() {
std::cout << "hello I am kouba!" << std::endl;
return 0;
}

3. In Java

In Java, we use the System.out.println() method to display a message.

public class Main {
public static void main(String[] args) {
System.out.println("hello I am kouba!");
}
}

4. In JavaScript

JavaScript allows to display messages via console.log() for web and Node.js environments.

console.log("hello I am kouba!");

5. In Python

Python simply uses the print() function to display text.

print("hello I am kouba!")

Explanation of the structure in each language

  • In C, we use printf to print the message and include a newline with \n. The main() function is required and the program returns 0 to indicate that it has completed successfully.

  • In C++, we import the iostream library and use cout with std::endl to add a newline at the end of the message. Here too, the program is structured around the main() function.

  • In Java, the basic structure involves creating a public class Main (or another class name) with a main method to run the program. The System.out.println() function is used to print the message and move to the next line.

  • In JavaScript, the console.log() command is used in scripts to display information in the console.

  • In Python, the print() command is simple and straightforward, it allows to display the text without a semicolon and with a newline by default.

Thus, this very simple algorithm is easily adaptable in different programming languages, each syntax having its particularities to accomplish the same task: displaying a message on the screen.


Thank you very much for reading, it's time to invite my friends @lil.albab, @miftahulrizky, @heriadi to participate in this contest.

Best Regards,
@kouba01

Sort:  
Loading...

Upvoted. Thank You for sending some of your rewards to @null. It will make Steem stronger.

This is a very informative post explaining the importance and basics of programming. The post describes everyday activities in the form of an algorithm, such as the process of preparing a class as a teacher. You have detailed each step that goes into creating an effective teaching material.

The post also beautifully describes the importance of programming languages ​​in the world and their day-to-day usage. You illustrated how programming languages ​​drive innovation in various fields, such as education, health, and industry.

Finally, the "Hello World" algorithm is demonstrated in various languages ​​such as C, C++, Java, JavaScript, and Python, which is a great stepping stone to understanding the basics of programming.

This post provides a great start for new programming learners as you have presented all the steps in a very organized manner.

Thanks for your thoughtful feedback! I'm glad you found this post informative and well-organized. It's great to know that the everyday examples and "Hello World" demonstration across different languages ​​resonated with you. I hope this helps new learners see the value of programming in everyday life and inspires them to explore further!

I know little bit bout c++ and java script but I gain knowledge from this post thank you