This course provides you with a foundation in basic programming concepts that are common to most high-level programming languages with an emphasis on structured programming. You will start by learning what a computer program is and about the environment in which it does its job.
As you progress through the course you will move from more general topics, such as how a computer stores numbers and text, to more specific topics, such as how to implement an algorithm for sorting data. Along the way you will have many opportunities to practice your new programming skills by writing computer programs in the
Java programming language. By the end of the course you will be ready to study more advanced topics in Java or to move on to another high-level programming language such as C or Visual Basic.
Structured programming is a programming paradigm aimed at improving code clarity, maintainability, and efficiency by using well-defined control structures. The key components of structured programming include:
-
Sequence
-
Selection (Decision Making)
-
Iteration (Loops)
-
Modularity (Use of Functions and Procedures)
- Code is divided into smaller, reusable units (functions or procedures).
- Promotes maintainability and reusability.
-
Example:
int add(int a, int b) {
return a + b;
}
int main() {
int sum = add(5, 10);
printf("%d", sum);
return 0;
}
- The
add
function can be used multiple times instead of repeating code.
-
Block Structures (Local Scope and Encapsulation)
-
Single Entry and Single Exit Principle
- Each function, loop, or decision structure should have one entry and one exit point.
- This improves readability and debugging.
Structured programming emphasizes breaking problems into smaller, manageable parts using these principles. It is widely used in languages such as C, Java, and Python, and forms the basis of modern programming methodologies.
After completing this course, you will be able to:
- Understand what a computer program is and how it works
- Describe how a computer stores numbers and text
- Use structured programming concepts
- Use the Java 2 Software Development Kit to develop Java programs
- Use Java's primitive data types
- Use Java's arithmetic, increment and decrement, remainder, relational, and logical operators
- Understand numeric promotion, truncation, conversion and casting, and operator precedence
- Use control flow constructs in a Java program
- Use class methods in a Java program
- Use arrays in a Java program
- Implement an algorithm for sorting data
C++, Java, and Python focus more on computer logic and less on the presentation.
In the next lesson, you will learn about prerequisites to this course.