Computer Science State Matura Test 1 Study Guide
Fundamentals of Computer Data and Units
Relationship Between Bit and Byte:
The bit (binary digit) is the smallest unit of information in computing.
A byte consists of a sequence of bits.
The mathematical relationship is precisely defined as: .
It is important to distinguish this from higher-level storage conversions where units like kilobytes (KB) typically involve a factor of (e.g., ).
C++ Programming: Data Types and Syntax
Integral Data Types:
In C++, the reserved word used to define an integer data type (whole numbers) is
int.Unsigned Integral Types: When a numerical value is strictly non-negative, an unsigned integral type can be used, often represented by the
unsigned intor similar keywords to store larger positive values by omitting the sign bit.
Real (Floating-Point) Data Types:
Variables intended to store real numbers (numbers with decimal points/fractions) are defined using the reserved word
doubleorfloat.The
doublekeyword specifically refers to double-precision floating-point numbers.
Character Data Types:
Individual characters are defined using the reserved word
char.
Computational Logic and Control Structures
Conditional Statements (if/else):
Scenario A:
int a=10; int b=8; if(a>b) cout<<a<<endl; else cout<<b<<endl;Logic: Since 10 > 8 is true, the program executes the
ifblock.Output:
10.
Scenario B:
int a=5; int b=3; if(a>b) cout<<a+b<<endl; cout<<a/b<<endl; cout<<a%b<<endl;Logic:
Check condition 5 > 3 (True).
Execute
cout<<a+b().Execute
cout<<a/b(Integer division: ).Execute
cout<<a%b(Modulo/remainder: ).
Output:
8,1,2(each on a new line).
Scenario C (Inequality Check):
int a=10; int b=8; if(a<=b) cout<<a<<endl; else cout<<b<<endl;Logic: Since is false, the program executes the
elseblock.Output:
8.
Switch-Case Statements and Fall-Through:
Code Example:
int a=0; switch (a) { case 0: cout <<"Ana"; case 1: cout <<"Jana"; case 2: cout <<"Petar"; case 3: cout <<"Andrej"; default: cout << "No name"; }Output Analysis: Because there are no
breakstatements after each case, the program enters atcase 0and executes all subsequent lines (fall-through).Current Output:
AnaJanaPetarAndrejNo name.Requirement for "No name" Output: To ensure the screen only displays "No name," the value of variable
amust be changed to anything other than (e.g.,int a=4;), orbreakstatements must be added to each individual case.
Do-While Loop Iteration:
Initial State:
s=0; a=1; b=5;Execution Steps:
Iteration 1:
s = 0+5=5;a=2;b=6. Condition is True.Iteration 2:
s = 5+6=11;a=3;b=7. Condition is True.Iteration 3:
s = 11+7=18;a=4;b=8. Condition is True.Iteration 4:
s = 18+8=26;a=5;b=9. Condition is True.Iteration 5:
s = 26+9=35;a=6;b=10. Condition is False (6 > 5).
Final Output:
35.
Software and System Architecture
Software Classification:
Software is generally categorized into two main divisions: System Software (programs that manage the hardware and provide a platform for applications) and Application Software (programs that allow users to perform specific tasks).
Microsoft Office: This is an example of an Office Software Suite, classified as Application Software.
Computer Parameters and Configuration:
The configuration of computer parameters (hardware settings, user accounts, system updates) is typically conducted through tools like the Control Panel or Settings menu.
Database Structure:
The main structural components (building blocks) of a database are Tables, Records (rows), and Fields (columns).
Networking Fundamentals
IP Address:
An IP (Internet Protocol) address is a unique numerical label assigned to each device connected to a computer network that uses the Internet Protocol for communication. It serves as a network interface identification and location addressing.
The Router:
A router is a hardware device used to connect multiple networks and route data packets between them based on IP addresses. It facilitates the communication between a local home network and the internet.
Practical Examination: Word, Excel, and Programming Tasks
MS Word Formatting Task:
Requires the creation of a document titled
Ime_i_prezime_word.Content focus: New Year messages and information regarding the Gregorian calendar.
Key phrases to include: "The New Year -- the day that marks the new calendar year," "Happy New Year!", "I believe that the new year will be the greatest year of your life."
MS Excel Data Processing:
Task: Calculate total points and player averages.
Required Formulas:
Total points for a player across different categories (e.g., -point baskets and -point baskets).
Average number of points using the function:
AVERAGE(range).Finding the best player: Use the
MAXfunction to identify the highest score.
Chart Creation: Create a column chart displaying "Student" names against their "Total points."
C++ Practical Problems:
Problem 1 (Find Maximum): Create a program where the user enters a series of numbers. The input loop terminates when the user enters . The program must output the largest (maximum) number entered during the sequence.
Problem 2 (Digit Analysis): Create a program that takes a natural number as input and calculates:
The Sum of its digits.
The Number of digits contained within the number.
Example logic: Using a while loop with the operations to extract the last digit and to remove it.