42 Questions
What is the main function of a program in relation to a computer?
It provides instructions for the computer to perform a task
What is the role of a software developer in relation to computer programs?
Designing, creating, and testing computer programs
What are the typical major components of a computer system?
Central processing unit, main memory, secondary storage devices, input and output devices
What is the function of the central processing unit (CPU) in a computer?
It actually runs programs
What is another name for main memory in a computer system?
Random Access Memory or RAM
What type of memory is used for temporary storage while a program is running?
Volatile memory
Where does a computer store a program while it is running?
Main memory (RAM)
What are microprocessors?
CPUs located on small chips
What is the function of an interpreter in a high-level language program?
Translates and executes instructions in a high-level language program
In what modes can the Python interpreter be used?
Interactive mode and Script mode
What is the purpose of the .py file extension in Python?
To indicate that the file contains Python script
What is IDLE in the context of Python programming?
An integrated development environment for Python
How are statements saved in a Python program for later execution?
By saving a set of Python statements in a file with .py extension
What happens when Python is started in interactive mode?
A prompt appears indicating that the interpreter is waiting for a Python statement to be typed
What type of memory is characterized by having no moving parts and storing data in solid state memory?
Solid state drives
Which type of device collects data from people and other devices, including examples like keyboard, mouse, touchscreen, scanner, and camera?
Input devices
What is the function of application software?
Makes a computer useful for everyday tasks
How is data stored in binary form as numeric codes?
Using ASCII and Unicode coding schemes
What is the role of a compiler or interpreter in high-level languages?
Translates keywords, operators, and syntax into machine language
What is the purpose of the fetch-decode-execute cycle in a computer program?
To carry out program instructions by the CPU
What is the main difference between assembly language and high-level languages?
High-level languages allow for simple creation of powerful and complex programs without needing to know how the CPU works
How are characters stored in binary form?
As numeric codes using ASCII and Unicode coding schemes
What is the main advantage of using named constants in programming?
Named constants make code self-explanatory and easier to maintain
What is a named constant in programming?
A name that represents a value that does not change during the program's execution
How do named constants help prevent typographical errors in programming?
By providing a single point of change for the value represented by the constant
What is a 'magic number' in programming?
A numeric value that is used directly in the code without explanation
What do named constants contribute to code readability and maintenance?
They provide meaningful names for values and make it easier to update values throughout the program
Which of the following best describes the purpose of pseudocode?
It is used for creating program designs and can be translated into actual code in any programming language
What is the main purpose of a flowchart in programming?
To visually represent the steps in a program using symbols for input, output, and processing
What does the petrol example algorithm involve?
Calculating the cost of n liters of petrol based on input price per liter and number of liters, and displaying the cost
What are the three steps involved in the process of a computer?
Input, process, output
What is the function of the print function in Python?
To display output on screen with the argument as data to be displayed
Which function can be used to convert a string to an integer in Python?
int()
What is the purpose of the modulus operator (%) in Python?
It calculates the remainder of a division.
When converting mathematical expressions to programming statements, what might be required for clarity?
Adding more parentheses
What is the purpose of the line continuation character (") in Python?
To concatenate strings
Why is it recommended to assign magic numbers to variables with descriptive names in programming?
To improve readability and understanding
What is the most important part of the program development cycle?
Designing the program
What is an algorithm in the context of program development?
A set of well-defined logical steps that must be taken to perform a task
What is the role of a software developer in relation to computer programs?
Translating user requirements into a program design
In what order does the program development cycle occur?
Design the program, write the code, correct syntax errors, test the program
What is the function of application software?
To provide tools for specific user tasks
Study Notes
-
Secondary storage: holds data for long periods, programs are stored here and loaded to main memory as needed
-
Disk drives: data is magnetically encoded onto a spinning circular disk
-
Solid state drives: faster than disk drives, no moving parts, data is stored in solid state memory
-
Flash memory: portable, no physical disk, data is stored in electrical charges
-
Input devices: data is collected from people and other devices, examples include keyboard, mouse, touchscreen, scanner, and camera
-
Disk drives are input devices as they load programs into the main memory
-
Output devices: produce data for other people or devices, examples include video display and printer
-
Disk drives and USB drives can be considered output devices as data is sent to them to be saved
-
Software: controls everything a computer does
-
Application software: makes a computer useful for every day tasks, examples are word processing, email, games, and web browsers
-
System software: controls and manages basic operations, examples are the operating system and utility programs
-
Software development tools: used to create, modify, and test software programs
-
Data in a computer is stored as binary sequences of 0s and 1s
-
A byte is a unit of data that can store a letter or small number, and is made up of eight bits
-
Each bit can hold a positive or negative charge, and their on/off pattern represents data
-
Computers use binary numbering system, with each digit representing a power of 2, and each byte can hold values between 0 and 255
-
Characters are stored in binary form as numeric codes, with ASCII and Unicode being common coding schemes
-
Advanced number storage techniques include encoding negative numbers using two's complement and real numbers using floating-point notation
-
Digital data, such as images and music, are stored as binary numbers representing pixels and samples respectively
-
A program works by the CPU performing simple operations on data and understanding instructions in machine language
-
Each program must be copied from secondary memory to RAM each time it is executed and goes through the fetch-decode-execute cycle
-
Assembly language is easier for programmers to work with as it uses short words for instructions instead of binary numbers
-
High-level languages allow for simple creation of powerful and complex programs without needing to know how the CPU works
-
Keywords, operators, and syntax are used to write programs in high-level languages and are translated into machine language by compilers and interpreters.
-
The
input()
function in programming reads user input from the keyboard and returns the data as a string. -
Users are prompted to enter a value with a given instruction.
-
The
input()
function always returns a string, but it can be converted to other data types using built-in functions. -
The
int()
andfloat()
functions can be used to convert a string to an integer or a floating-point number, respectively. -
Type conversion only works if the input string is a valid numeric value; otherwise, an exception is thrown.
-
When performing calculations, Python follows a specific order of precedence, and parentheses can be used to force the order of operations.
-
The exponentiation operator (**), the exponent operator, and the remainder operator (%), also called the modulus operator, are used for raising numbers to a power and for converting times and distances, respectively.
-
When converting mathematical expressions to programming statements, multiplication operators might need to be added, and parentheses might be required for clarity.
-
Variables can reference different values while the program is running, and data type conversions can be performed during reassignment.
-
In situations where long statements are hard to read, they can be broken into multiple lines using the line continuation character () or the parentheses.
-
The
print()
function is used to display output on the screen, and it has various special arguments for customizing the output format, such as delimiters, separators, and format specifiers. -
Formatting numbers can be done using the
format()
function, which allows controlling the display of precision, data type, and various other formatting options. -
Magic numbers are unexplained numeric values that appear in the code. They can lead to confusion and make the code harder to maintain. It is generally recommended to assign magic numbers to variables with descriptive names instead.
Test your knowledge of the basics of computers, programming, hardware, software, and the Python language with this introductory quiz.
Make Your Own Quizzes and Flashcards
Convert your notes into interactive study material.
Get started for free