Introduction

Before learning the PHP programming language, it is generally recommended to study a few foundational concepts that will facilitate your understanding of PHP.

Overview

At the outset, students are introduced to small programs that contain the building blocks of programming: expressions, assignments, conditionals, and loops. In reality, a program is a mixture of these building elements. Students need to synthesize and integrate their knowledge by “deconstructing” sample programs, extracting elements for adaptation, and then reconstructing a complete program to solve the problems they face.

This embodies the essence of Computational Thinking. Problem decomposition is done by breaking a program down into small syntactical elements to form a cohesive solution. Patterns are expected to emerge from the basic syntactical elements learned through small programs, leading to solution patterns for larger problem types. Based on this approach, “Starting Basic Programming with C/C++” consists of several modules:

  • Introduction: Covers the history of PHP, example applications, and relevant terminology, including recommended IDEs.
  • Small Programs in PHP: Introduces PHP through the simplest program, “Hello World.”
  • Initialization and Assignment: Explains variables and basic data types like integers, real numbers, and characters/strings, as well as the two ways to assign values to variables: initialization and assignment.
  • Constants: Introduces the concept of constants, which are variables that cannot be changed, and distinguishes between constants and variables.
  • Input/Output: Teaches how to read and write values to variables.
  • Simple Operations in PHP: Covers operations in PHP, including arithmetic, boolean, comparisons, etc.
  • Conditional Statements: Introduces conditional instructions to control the program flow.
  • Loops: Introduces looping constructs for repeating instructions, such as for, while-do, do-while, and for.
  • Arrays: Introduces arrays for storing multiple values in a matrix format.
  • Subprograms: Introduces functions and procedures as abstractions of computational processes that can be called by a program.
  • Conclusion: Tests understanding of PHP through exercises that reinforce concepts in a simple program, including computation operations, conditional statements, loops, arrays, and functions.

Programming algorithm learning will emphasize practice, with a class composition of 20% theory and 80% practice, ensuring more time is spent writing code than on theoretical concepts.

Introduction to PHP

PHP, which stands for PHP: Hypertext Preprocessor, is a widely-used, open-source scripting language designed for web development. PHP, originally created by Rasmus Lerdorf in 1994. Here are some key points about PHP:

What is PHP?

  • Server-Side Scripting: PHP code is executed on the server, and the result is sent to the client’s browser as plain HTML.
  • Open Source: PHP is free to download and use.
  • Embedded in HTML: PHP can be embedded within HTML, making it easy to add dynamic content to web pages.

Key Features

  • Dynamic Content: PHP can generate dynamic page content.
  • File Handling: It can create, open, read, write, delete, and close files on the server.
  • Form Data: PHP can collect form data and send/receive cookies.
  • Database Interaction: It can add, delete, and modify data in databases.
  • User Access Control: PHP can control user access and encrypt data.

Why Use PHP?

  • Cross-Platform: PHP runs on various platforms like Windows, Linux, Unix, and Mac OS X.
  • Server Compatibility: It is compatible with almost all servers used today (e.g., Apache, IIS).
  • Database Support: PHP supports a wide range of databases.
  • Ease of Learning: PHP is relatively easy to learn and use, making it a great choice for beginners.

History of PHP

Early Beginnings

  • 1994: Rasmus Lerdorf developed PHP as a set of Common Gateway Interface (CGI) binaries written in C. It was initially called “Personal Home Page Tools” and was used to track visits to his online resume.
  • 1995: Lerdorf released the source code for PHP Tools to the public, allowing developers to use and improve it. This version included basic functionality for dynamic web applications.

Evolution into PHP/FI

  • 1995: The tools were renamed to “Forms Interpreter” (FI) and included Perl-like variables and HTML embedded syntax.
  • 1996: The name was changed to PHP/FI, combining the names of past releases. This version included support for databases and user-defined functions.

Major Versions

  • PHP 3 (1997): This version was a complete rewrite and introduced a more powerful and consistent language structure. It gained significant popularity and laid the foundation for future versions.
  • PHP 4 (2000): Powered by the Zend Engine, PHP 4 improved performance and added more features, making it suitable for complex web applications.
  • PHP 5 (2004): Introduced object-oriented programming (OOP) features, making it more versatile and powerful.
  • PHP 7 (2015): Brought major performance improvements and new features like scalar type declarations and return type declarations.
  • PHP 8 (2020): Introduced the Just-In-Time (JIT) compiler, improving performance and adding new features like union types and attributes.

Current State

PHP continues to evolve, with the latest stable release being PHP 8.4.2 as of December 2024. It remains one of the most widely used server-side scripting languages for web development.

Introduction to Basic Programming Algorithms

To start understanding programming algorithms and writing code, we need to grasp some fundamental concepts to facilitate easier learning and engagement with future material.

  1. How to Write and Read Code
    When writing programs, the first thing to consider is how to read and write code. This is similar to our general reading and writing practices. In programming, the concept is to read and write code from top to bottom. Sometimes this is overlooked, leading to serious errors in the code, due to improper sequencing that fails to follow the top-down writing principle. The computer reads our code sequentially from top to bottom, so if it’s not arranged correctly, it can result in significant errors. This seemingly simple point is crucial; hence, a basic understanding of code writing is essential.

  2. Importance of Documentation
    When learning a programming language, it’s important to read the official documentation to minimize potential mistakes and errors. Each programming language has different standards for its syntax; thus, documentation is vital and should be consulted. You can find the official documentation for any programming language you study online.

  3. Indentation & Program Blocks
    Indentation refers to starting text with empty spaces between the text and the margin. A tab is used for indentation, with a tab typically equaling 4 spaces. Indentation is commonly used within program blocks. Different programmers around the world may use varying indentation standards depending on their project guidelines. In individual projects, it’s common to see programmers using 2-space indentation, while in cases like the Linux kernel project initiated by Linus Torvalds, an 8-space standard is used for better code readability. The most common practice, however, is to use 4 spaces for indentation, aligning with the tab character.

    In programming languages, a program block is an approach that allows users to create programs by assembling interrelated blocks of code. A program block generally begins with an opening curly brace “{“ and ends with a closing curly brace “}”. In some programming languages, like Python, curly braces do not represent program blocks; instead, another symbol like “:” is used.

    To declare a program block (from { to }), it can be demonstrated as follows, with syntax explained after the indentation:

    1
    2
    3
    4
    5
    for ($i = 0; $i < 7; $i++)
    { // Entering Program Block
    [Tab]<Code>
    [Tab]<Code>
    } // Ending Program Block

    Here’s an example of a nested program block:

    1
    2
    3
    4
    5
    6
    7
    8
    9
    function fs_tf_analyzeFileUpCommand($cmd, $size)
    { // Entering Program Block 1
    [Tab]for ($i = 0; $i < $size; $i++)
    [Tab]{ // Entering Program Block 2
    [Tab][Tab]<Code>
    [Tab][Tab]<Code>
    [Tab]} // Ending Program Block 2
    [Tab]return OK_CMD;
    } // Ending Program Block 1
  4. Comments
    In writing code, it’s sometimes necessary to add comments in specific sections for clarification. Why is this important? Consider if you’re working in a team on a complex program and you only write code without any comments. How will your teammates understand your work? It would complicate their ability to continue from where you left off. This illustrates the importance of comments in programming. Comments can be single-line or multi-line. A single-line comment typically starts with “//“ and has no ending. For multi-line comments, they usually begin with “/“ and end with “/“. Other programming languages, like Python, may use a different syntax, such as “#” for single-line comments. Therefore, when learning a new programming language, be sure to read its documentation regarding comment syntax.

    Here’s an example of comment usage:

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    if ($filePtr == null)
    {
    // Single-line comment

    /* Comment
    More
    Than
    One Line */
    return 0;
    }

    Note: Single-line comments “//“ are not applicable in C, so to create comments in C, use “/ /“. Single-line comments “//“ can still be used in C++.

  5. Naming Conventions
    When learning a programming language, it’s important to pay attention to the rules for naming variables, functions, classes, etc. Naming conventions are largely similar across languages and help make code easier to read. Here are three key points to consider when naming:

    • Choose names that distinguish different data types.
    • Use data type keywords as part of the naming convention to indicate the contents of a variable/function/class after declaration, which also minimizes errors.
    • Use names that are easily recognizable and understandable (avoid abbreviations that only you and your close associates would know, like x = 5).

    Here are some additional important guidelines for naming:

    • Use these naming conventions as a general reference and adjust them as necessary for the programming language you are using, as each language has its own naming rules (Read the Official Documentation!).
    • Avoid naming anything with keywords (if, else, for, while, etc.), as this will cause errors and make the program unreadable.
    • Refrain from using initials, such as single letters for variable/function/class names in complex programs, as this can be confusing and hard to differentiate.
    • Do not start variable/function/class names with numbers, as the compiler will interpret them as values rather than names. If your variable/function/class requires numbers, those should not be at the beginning.
    • Avoid generic names like “data” for variables/functions/classes. Naming something “data” doesn’t clarify anything and will confuse you when maintaining code or adding new features later. Instead, use names that describe the value of the variable/function/class itself.
    • Variables in languages like JavaScript should start with a letter or an underscore. You cannot create a variable starting with a number or using symbols other than the underscore.
    • Variable/function/class names cannot contain spaces. If a name consists of more than two words, use camelCase (e.g., FirstName, LastName, CatName) or underscores as a substitute for spaces (e.g., First_Name, Last_Name).
    • Variable/function/class names should not contain special characters (!,/,+,*,=, etc.).
    • Avoid using all capital letters for variable names (e.g., NAME, PLACE, LIFE) as these are typically reserved for constants (values that cannot change).

    Here are some rules for creating functions/classes:

    • Avoid using too many parameters in a function unless necessary. If there are too many arguments, it becomes difficult to test or use. If more than three function arguments are needed, consider consolidating or discussing this with your team. Instead of adding numerous function parameters, utilize objects as parameters.
    • Make each function perform a single task. Functions that do too many things can be hard to compile and test. Functions with multiple responsibilities also lack a clear purpose. When a function does more than one thing, try breaking it down so that each function truly performs one task. This also results in cleaner and more readable code.
    • Function names should represent their purpose. Ensure the name reflects the intent or task of the function. This helps other developers/programmers easily understand the purpose of the function you create.
    • Create functions to avoid code duplication. If you find yourself frequently writing repetitive code, you should pay attention to that code. Repeated code is a strong candidate for being made into a function, allowing it to be reused simply by calling the function.
  6. Running Programs
    To run our code, we first need to determine whether the programming language we are learning is executed using a compiler or an interpreter.

    • Compiler: A compiler translates code from a high-level programming language into machine code before the program is executed. The compiler reads the entire file and processes it all at once, outputting the result (whether it runs successfully or produces errors) even if there are errors in the code. Examples of programming languages that use compilers are C/C++ and Java.
    • Interpreter: An interpreter translates code written in a high-level programming language into machine code line by line as the code is executed. The interpreter reads each line, and if an error occurs, the program immediately stops at the line where the error happened. An example of a programming language that uses an interpreter is Python.
  7. Types of Errors
    It wouldn’t be complete without discussing errors in programming algorithms. An error is a mistake that occurs in the writing of code. Generally, there are many types of errors, depending on the programming language. Here are some types of errors that you may encounter when learning a programming language:

    • Logical Error: This is the hardest type of error to detect. It occurs not due to a syntax error or a runtime issue, but because of a mistake in the algorithm written by the programmer. When the logic is wrong, the output will also be incorrect. Detecting logical errors can be quite difficult and time-consuming. Most logical errors arise from calculation mistakes or using the wrong variables. Typically, a logical error will not cause the program to stop completely; the program can still run normally but will not function as intended.
    • Syntax Error: One of the most common types of errors in programming is the syntax error. This error occurs when there is a typo in a keyword or an issue with the structure of the code. When a syntax error occurs, the code will not run correctly because the computer cannot understand it. Fixing this type of error usually just requires careful checking for typos.
    • Runtime Error: This type of error occurs while a program is running. There are several causes for runtime errors, such as input errors, calculation mistakes, and output problems. When a runtime error occurs, there is a significant potential for the program to crash. To fix this type of error, the programmer must go back to the development phase to identify the issue.
    • Compilation Error: This error occurs during the process where code written in a high-level language is converted into a machine-readable format. Various types of errors, such as syntax errors, can arise during this process. Sometimes, even if the syntax is correct, a compilation error may still occur due to issues with the compiler itself. However, don’t worry; this type of error can be fixed during the development phase.
    • Interfacing Error: This type of error is likely to occur due to incompatibility between the software program and the hardware interface being used. In the case of web applications, it often arises from incorrect use of web protocols.
    • Arithmetic Error: This is a type of error that falls under logical errors, but it specifically involves mathematical calculations rather than syntax errors. It generally occurs when the computer cannot perform a calculation as instructed by the programmer. For example, trying to divide by zero can lead to an error that prevents the program from running correctly. To address this, you can:
      • Understand basic mathematical operations.
      • Avoid mistakes with parentheses or the order of operations.
      • Use negative numbers in calculations.
      • Implement error handling methods such as try, catch, except, etc.
    • Resource Error: This type of error occurs when the value of a variable exceeds the maximum limit that the programming environment can handle. A program will use a certain amount of resources provided by the computer to run. When the program requires more resources than the computer can provide, it leads to a resource error. To mitigate this, you can use load-testing applications to understand what happens when you run the same program simultaneously multiple times.
    • Semantic Error: This type of error is similar to a logical error; however, the difference is that a logical error produces incorrect data, while a semantic error produces something that is meaningless.

    Errors mentioned above can often be avoided if you are more meticulous and plan well during the code-writing phase.

Flowchart & Pseudocode

Flowcharts and pseudocode are fundamental tools for learning algorithms and basic programming before writing actual code. Generally, to understand the flow of a program, we need to grasp how the program operates. To simplify this, you can illustrate it using a flowchart. Another method besides drawing a flowchart is to write pseudocode, which is a representation of the code you will write later.

Diagram Alur (Flowchart) dan Pseudocode merupakan sebuah dasar untuk mempelajari algoritma dan pemrograman dasar sebelum menulis sebuah kode. Umumnya untuk mengetahui sebuah alur program, kita perlu memahami gambaran bagaimana alur program itu berjalan. Untuk mempermudah maka anda dapat menggambarkannya menggunakan diagram alur. cara lainnya selain menggambar diagram alur ialah dengan menulis sebuah pseudocode atau sebuah kalimat yang mewakilkan kode program yang akan kamu tulis nanti.

Flowchart

Flowchart atau diagram alur adalah alat visual yang digunakan untuk merepresentasikan alur kerja atau proses dalam bentuk diagram. Dalam ranah IT sendiri biasanya diagram alur dipergunakan untuk menggambarkan alur program sebelum melakukan eksekusi (menulis kode) program. Secara umumnya diagram alur digunakan untuk merencanakan, menganalisis, dan memahami langkah-langkah yang diperlukan dalam menyelesaikan suatu tugas atau masalah. Diagram alur memiliki beberapa aturan dalam pembuatannya, aturan tersebut berlaku pada setiap simbol alur yang akan dibuat. berikut ini adalah aturan setiap simbol dalam pembuatan diagram alur.

Aturan Setiap Simbol dalam Diagram Alur

Simbol Flowchart dan Fungsinya

Simbol-simbol dalam flowchart memiliki makna dan fungsi tertentu yang membantu dalam pemahaman alur kerja. Beberapa simbol dasar flowchart meliputi:

  1. Simbol Awal (Start/End):
    Simbol ini menandakan awal dan akhir dari suatu proses atau algoritma. Biasanya direpresentasikan dengan bentuk oval atau persegi panjang dengan tepi melengkung.

  2. Simbol Proses:
    Simbol ini digunakan untuk menunjukkan langkah-langkah atau tindakan yang harus dilakukan dalam proses. Umumnya direpresentasikan dengan bentuk persegi panjang.

  3. Simbol Keputusan (Decision):
    Simbol ini menunjukkan titik keputusan dalam alur kerja yang memerlukan pilihan ya atau tidak. Biasanya direpresentasikan dengan bentuk diamond.

  4. Simbol Input/Output:
    Simbol ini digunakan untuk menunjukkan input atau output data dalam proses. Biasanya direpresentasikan dengan bentuk paralelogram.

  5. Simbol Penghubung (Connector):
    Simbol ini digunakan untuk menghubungkan bagian-bagian flowchart yang terpisah. Biasanya direpresentasikan dengan garis lurus atau panah.

Fungsi Flowchart dalam Ranah IT

Flowchart memiliki beberapa fungsi penting dalam ranah IT, antara lain:

  1. Merencanakan Proses:
    Flowchart membantu dalam merencanakan langkah-langkah yang diperlukan dalam menyelesaikan suatu tugas atau masalah dengan jelas dan terstruktur.

  2. Menganalisis Algoritma:
    Dengan menggunakan flowchart, kita dapat menganalisis algoritma secara visual dan memahami logika yang digunakan dalam proses pemrograman.

  3. Memudahkan Komunikasi:
    Flowchart menjadi alat komunikasi yang efektif antara programmer, analis, dan pengguna dalam memahami alur kerja suatu sistem atau program.

  4. Memperbaiki Kesalahan:
    Dengan melihat flowchart, kita dapat mengidentifikasi dan memperbaiki kesalahan atau bug dalam algoritma dengan lebih cepat dan efisien.

Contoh Flowchart dalam Pemrograman

Berikut adalah contoh sederhana flowchart dalam pemrograman:

  1. Flowchart Menghitung Luas Segitiga:
    Contoh ini menunjukkan alur kerja dalam sebuah program sederhana untuk menghitung luas segitiga.

    Algoritma Menghitung Luas Segitiga

  2. Flowchart Filtering Ganjil Genap
    Contoh ini menunjukkan alur dari apakah angka yang diinput apakah ganjil atau genap.

    Algoritma Kategorisasi Biangan Ganjil Genap

Flowchart memungkinkan Anda untuk dengan lebih mudah menjelaskan alur suatu program, karena tujuannya adalah untuk menguraikan proses-proses menggunakan simbol-simbol. Selain itu, flowchart juga dapat berfungsi sebagai alat untuk menyampaikan informasi tentang program kepada orang lain.

Pseudocode

Pseudocode adalah sebuah metode yang digunakan untuk menggambarkan algoritma atau logika dari suatu program tanpa harus menggunakan bahasa pemrograman tertentu. Metode ini menjadi alat yang sangat berguna bagi para pengembang, terutama untuk mempermudah perencanaan dan pemahaman alur program.

Ciri-ciri Pseudocode

  1. Menggunakan Bahasa Natural
    Pseudocode umumnya ditulis dalam bahasa sehari-hari atau bahasa yang mendekati bahasa natural, sehingga lebih mudah dipahami oleh siapa saja, baik oleh programmer maupun orang non-teknis.

  2. Struktur yang Jelas
    Pseudocode harus memiliki struktur yang terorganisir dengan baik, seperti memiliki urutan instruksi yang jelas dan terstruktur.

  3. Tidak Tergantung pada Sintaks
    Tidak seperti bahasa pemrograman, pseudocode tidak memiliki aturan sintaksis yang ketat sehingga lebih fleksibel dalam penulisannya.

  4. Detail Algoritma
    Meskipun tidak detail seperti bahasa pemrograman, pseudocode tetap menyertakan langkah-langkah utama dalam sebuah algoritma yang perlu dipahami.

  5. Konsistensi
    Menjaga konsistensi dalam penulisan pseudocode penting untuk memastikan pembaca dapat mengikuti logika dari awal hingga akhir.

  6. Menggunakan Simbol
    Terkadang, simbol-simbol dasar seperti tanda “=” atau operator logika digunakan untuk memperjelas langkah dalam pseudocode.

  7. Dapat Digunakan untuk Pemrograman
    Pseudocode sering digunakan sebagai dasar untuk mengkonversi langkah-langkah menjadi kode program pada bahasa pemrograman tertentu.

Fungsi Pseudocode

  1. Mempermudah Pemahaman
    Salah satu fungsi utama pseudocode adalah untuk memudahkan pemahaman tentang bagaimana algoritma atau program seharusnya berjalan.

  2. Perencanaan Program
    Sebelum menulis kode pada bahasa pemrograman tertentu, pseudocode membantu dalam merencanakan setiap langkah secara logis.

  3. Alat Dokumentasi Penyelesaian Masalah
    Pseudocode dapat dijadikan alat dokumentasi untuk menggambarkan solusi dari suatu masalah, sehingga dapat diacu kembali di masa depan.

  4. Komunikasi
    Pseudocode berfungsi sebagai alat komunikasi antar programmer atau antar anggota tim untuk mendiskusikan solusi secara lebih mudah.

  5. Membantu Menerjemahkan Bahasa Pemrograman
    Pseudocode memberikan gambaran umum yang dapat diterjemahkan ke berbagai bahasa pemrograman.

  6. Lebih Ringkas dan Praktis
    Pseudocode lebih sederhana dan ringkas dalam penulisan dibandingkan kode program, namun tetap memuat langkah-langkah penting.

Struktur Pseudocode

  1. Judul
    Biasanya, judul pada pseudocode menunjukkan tujuan dari algoritma yang dibuat, seperti “Menghitung Luas Lingkaran”.

  2. Deklarasi
    Bagian ini berisi deklarasi variabel atau parameter yang digunakan dalam algoritma.

  3. Implementasi
    Langkah-langkah atau instruksi yang harus dijalankan dalam algoritma ditulis di bagian ini.

Kelebihan Pseudocode

  1. Mudah Dipahami
    Karena ditulis dalam bahasa yang lebih umum, pseudocode dapat dipahami oleh berbagai kalangan, baik yang ahli maupun yang masih belajar.

  2. Fleksibel
    Pseudocode tidak terikat oleh sintaks tertentu sehingga dapat lebih bebas dalam penulisannya.

  3. Dokumentasi yang Baik
    Sebagai dokumentasi, pseudocode memudahkan dalam memahami kembali algoritma di masa depan.

Kekurangan Pseudocode

  1. Tidak Standar
    Karena tidak memiliki aturan baku, pseudocode terkadang bervariasi antar penulis, yang bisa menyebabkan kebingungan.

  2. Tidak Dapat Dieksekusi
    Pseudocode hanya berfungsi sebagai deskripsi dan tidak dapat dijalankan pada komputer.

  3. Kurang Detail
    Karena hanya memberikan gambaran umum, beberapa detail dari algoritma mungkin tidak dicantumkan.

  4. Subjektivitas
    Penulisan pseudocode bersifat subjektif, sehingga interpretasinya bisa berbeda.

Contoh Algoritma Pseudocode

  1. Mencari Luas Segitiga

    1
    2
    3
    4
    5
    Judul: Mencari luas segitiga
    Deklarasi: alas, tinggi
    Implementasi:
    luas = 1/2 * alas * tinggi
    Tampilkan luas
  2. Menentukan Sebuah Bilangan adalah Ganjil atau Genap
    Pseudocode:

    1
    2
    3
    4
    5
    6
    7
    Judul: Menentukan bilangan ganjil/genap
    Deklarasi: bilangan
    Implementasi:
    Jika bilangan % 2 == 0
    Tampilkan "Genap"
    Jika tidak
    Tampilkan "Ganjil"
  3. Contoh Bentuk Lain Pseudocode dan Implementasinya dalam Code
    Pseudocode:

    1
    2
    3
    4
    5
    6
    Judul: Cetak Hal berikut
    Deklarasi:
    Implementasi:
    CETAK nama saya
    CETAK asal saya
    CETAK pekerjaan saya

    PHP Code:

    1
    2
    3
    4
    5
    echo("Zulma")

    echo("Bintaro")

    echo("Software Quality Assurance")

Pseudocode adalah alat yang sangat penting dalam pemrograman untuk mempermudah perencanaan dan pemahaman algoritma sebelum dikodekan. Dengan menggunakan pseudocode, kita dapat mendesain solusi masalah secara jelas, terstruktur, dan mudah dipahami oleh berbagai kalangan. Kendati memiliki beberapa kekurangan, seperti sifatnya yang tidak dapat dieksekusi, pseudocode tetap menjadi dasar yang kuat dalam perancangan algoritma yang baik.

Exercise

Kerjakan Latihan Berikut ini untuk mengetes pemahamanmu tentang materi yang telah diajarkan diatas.

Flowchart & Pseudocode Exercise

Flowchart & Pseudocode Exercise 1

Buat diagram alur serta pseudocode untuk menghitung luas lapangan sepak bola. (estimasi 10 Menit)

Flowchart & Pseudocode Exercise 2

Buat diagram alur serta pseudocode untuk menghitung luas lingkaran. (estimasi 10 Menit)

Flowchart & Pseudocode Exercise 3

Buat diagram alur serta pseudocode untuk menentukan kelulusan siswa/mahasiswa. (estimasi 10 Menit)

Flowchart & Pseudocode Exercise 4

Buat diagram alur serta pseudocode untuk mengkonversi suhu. (estimasi 30 Menit)

  • Celcius ke Fahrenheit
  • Celcius ke Kelvin
  • Fahrenheit ke Celcius
  • Fahrenheit ke Kelvin
  • Kelvin ke Celcius
  • Kelvin ke Fahrenheit

Basic Exercise

Ubah pseudocode dibawah ini menjadi sebuah program yang ditulis dalam bahasa Pemrograman Python. (estimasi 5 menit)

1
2
3
4
5
6
7
8
Judul: Cetak Hal berikut
Deklarasi:
Implementasi:
CETAK nama kamu
CETAK asal kamu
CETAK pekerjaanmu
CETAK negara asalmu
CETAK hal yang kamu suka