What is Programming?
Purpose and Applications



Understanding Programming

Programming is the process of writing instructions that a computer can understand and execute.

These instructions, known as code, tell the computer how to perform specific tasks such as calculations, data processing, decision-making, and interacting with users or other systems.

Why Do We Program?

Applications of Programming

Let’s See an Example

Let’s write a simple program to calculate the total cost of items in a shopping cart.

// Calculate total cost of items
SET item1_price = 20
SET item2_price = 35
SET item3_price = 15

SET total_cost = item1_price + item2_price + item3_price

PRINT "Total cost is: " + total_cost

Output:

Total cost is: 70

Explanation:

This program defines the prices of three items and adds them up to get the total. Finally, it displays the total cost. Programming lets us solve such problems efficiently and accurately.

Question:

Q: What happens if we want to calculate the total for 100 items?

A: We’d use loops or data structures (like arrays) to automate the addition instead of repeating each variable manually. This shows how programming helps scale operations.

Another Example – Making Decisions

Let’s say we want to decide whether someone can vote based on their age.

// Check if user is eligible to vote
SET age = 20

IF age >= 18 THEN
    PRINT "You are eligible to vote."
ELSE
    PRINT "You are not eligible to vote."

Output:

You are eligible to vote.

Explanation:

In this program, we use a conditional statement to check if the user is at least 18 years old. Based on the result, we display the appropriate message. This is how computers make logical decisions through programming.

Key Takeaways

Beginner Tip

Start thinking in steps. If you can write down how to solve a problem using words or flowcharts, you're already thinking like a programmer!



Welcome to ProgramGuru

Sign up to start your journey with us

Support ProgramGuru.org

Mention your name, and programguru.org in the message. Your name shall be displayed in the sponsers list.

PayPal

UPI

PhonePe QR

MALLIKARJUNA M