Questions 1
Comments are important for every computer program. One should always place a comment at
the start of a program to ensure:
- The purpose of
... [Show More] the program
- An outline of how the program carries out its tasks
- Who wrote the program and when
- A list of any changes to the program and when they were made
- Anything else which might help a reader to understand the program
Question 2
Programs must be able to operate on data such as numbers and characters. This data must be
stored in the computer memory.
Associated with each variable is a type, which restricts the sort of data that can be stored in the
variable.
- Int num; (What type) is declared as an integer variable.
- Int age; This declares a variable called age, of type int. A box where you are allowed to
place whole numbers.
- Char letters; The first part denotes the type and the second part the name of the
variable. A box where you are allowed to put in characters.
A variable name must start with a letter of the alphabet, an underscore or a dollar sign. From the
second letter onwards, you may use numeric digits as well as letters of the alphabet, underscores
and the dollar sign.
Question 3
Extreme precision programming is a style of programming that aims to perform the intended
function, while being very noisy about anything that deviates from the intended mode of
behavior. It is nothing like a complete methodology, but rather a philosophical learning to guide
choices at the implementation level.
In other words, a computer needs to be told exactly what to do and once they are told what to do,
they know exactly what to do. In order for a computer to do what it was told to do, or to perform
a specified task, that computer must be programmed with precised instructions written in a
language a computer understands (binary codes).
One cannot expect a computer to perform a specific task without teaching a
computer/programming the computer on how to perform a specific task. [Show Less]