Fundamentals of program development

From Computer Science Wiki
Revision as of 11:24, 3 January 2023 by Bmackenty (talk | contribs)

Students must be able to explain how algorithms can be developed into programs, and multiple programs can be assembled and re-used to solve new problems.


An algorithm is a set of steps or procedures that are followed in a specific order to solve a problem or accomplish a task. Algorithms can be developed into programs by expressing them in a programming language and using a compiler or interpreter to translate the program into a form that can be run on a computer.

Once an algorithm has been developed into a program, it can be reused to solve new problems by modifying the input data or the parameters of the program. For example, if a program has been developed to sort a list of numbers, it could be reused to sort a list of strings or a list of objects by modifying the input data.

Multiple programs can also be combined or assembled to solve new problems. This is often done by writing programs that use the functionality of other programs as building blocks, or by writing programs that coordinate the execution of multiple programs. For example, a program might use a library of functions to perform common tasks, or it might use a command-line utility to perform a specific task and then process the output of that utility.

In this way, algorithms can be developed into programs, and programs can be combined and reused to solve new problems, making it possible to build complex systems and solutions from smaller, reusable components.

Students must be able to discuss the advantages of using a good and consistent programming style throughout their programs including effective comments, naming conventions, and indentation of code to show program structure.

Using a good and consistent programming style throughout a program has several advantages:

Improved readability: A consistent programming style makes the code easier to read and understand, especially for other people who may need to work with the code in the future. Effective comments, clear naming conventions, and proper indentation can all help to make the code more readable and easier to understand.

Increased maintainability: Code that is easy to read and understand is also easier to maintain. If the code is well-documented and follows a consistent style, it will be easier for someone to modify or update the code as needed.

Enhanced collaboration: When multiple people are working on the same codebase, it is important to have a consistent programming style to ensure that the code is easy for everyone to understand. A consistent style also makes it easier for people to work together, as they don't have to spend time trying to understand each other's individual styles.

Reduced errors: Code that is easy to read and understand is less likely to contain errors. By following a consistent style and using effective comments, it is easier to identify and correct mistakes in the code.

Improved professionalism: Code that is well-written and follows a consistent style is a sign of professionalism. This can be important when working on projects for clients or when sharing code with the broader programming community.

Overall, using a good and consistent programming style throughout a program has numerous advantages that can improve the quality, maintainability, and professionalism of the code.

Students must be able to discuss how data is stored in memory and manipulated using variables and constants.

Data is stored in memory in a computer by assigning it to variables or constants.

A variable is a named location in memory where data can be stored and manipulated. The value of a variable can be changed during the execution of a program, and different data types can be stored in different types of variables. For example, an integer variable might be used to store a whole number, while a string variable might be used to store a sequence of characters.

A constant is also a named location in memory where data is stored, but the value of a constant cannot be changed once it is set. Constants are often used to store values that will not change throughout the execution of a program, such as mathematical constants or configuration settings.

Both variables and constants are used to store and manipulate data in a program, but they have different characteristics and are used in different ways. Variables are used to store data that will change during the execution of a program, while constants are used to store data that will not change.

Students must be able to manipulate and compare data using mathematical (+, -, /, *, %) and logical (<=, <, >, >=, ==, !=, !, &&, ||) operators.


Mathematical operators are used to perform mathematical operations on data, such as addition, subtraction, multiplication, and division. These operators include:

+ : adds two values together - : subtracts one value from another / :(division): divides one value by another

* : multiplies two values together

% : (modulus): returns the remainder of a division operation

Logical operators are used to perform logical operations on data, such as comparisons or negations. These operators include:

<= (less than or equal to): returns true if the value on the left is less than or equal to the value on the right < (less than): returns true if the value on the left is less than the value on the right > : returns true if the value on the left is greater than the value on the right

>= (greater than or equal to): returns true if the value on the left is greater than or equal to the value on the right

== (equal to): returns true if the value on the left is equal to the value on the right != (not equal to): returns true if the value on the left is not equal to the value on the right ! (not): returns the negation of a value (e.g., !true returns false) && (and): returns true if both values are true || (or): returns true if either value is true These operators can be used to manipulate and compare data in a program, allowing you to perform calculations, make decisions, and control the flow of a program based on the values of different variables or constants.