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: 1 Byte (B)=8 bits (b)1\text{ Byte (B)} = 8\text{ bits (b)}.

    • It is important to distinguish this from higher-level storage conversions where units like kilobytes (KB) typically involve a factor of 10241024 (e.g., 1 KB=1024 B1\text{ KB} = 1024\text{ B}).

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 int or 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 double or float.

    • The double keyword 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 if block.

      • 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:

        1. Check condition 5 > 3 (True).

        2. Execute cout<<a+b (5+3=85+3 = 8).

        3. Execute cout<<a/b (Integer division: 53=1\frac{5}{3} = 1).

        4. Execute cout<<a%b (Modulo/remainder: 5(mod3)=25 \pmod 3 = 2).

      • 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 10810 \le 8 is false, the program executes the else block.

      • 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 break statements after each case, the program enters at case 0 and 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 a must be changed to anything other than 0,1,2, or 30, 1, 2, \text{ or } 3 (e.g., int a=4;), or break statements must be added to each individual case.

  • Do-While Loop Iteration:

    • Initial State: s=0; a=1; b=5;

    • Execution Steps:

      1. Iteration 1: s = 0+5=5; a=2; b=6. Condition a5a \le 5 is True.

      2. Iteration 2: s = 5+6=11; a=3; b=7. Condition a5a \le 5 is True.

      3. Iteration 3: s = 11+7=18; a=4; b=8. Condition a5a \le 5 is True.

      4. Iteration 4: s = 18+8=26; a=5; b=9. Condition a5a \le 5 is True.

      5. Iteration 5: s = 26+9=35; a=6; b=10. Condition a5a \le 5 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:

      1. Total points for a player across different categories (e.g., 22-point baskets and 33-point baskets).

      2. Average number of points using the function: AVERAGE(range).

      3. Finding the best player: Use the MAX function 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 00. The program must output the largest (maximum) number entered during the sequence.

    • Problem 2 (Digit Analysis): Create a program that takes a natural number nn as input and calculates:

      1. The Sum of its digits.

      2. The Number of digits contained within the number.

      • Example logic: Using a while loop with the operations n(mod10)n \pmod {10} to extract the last digit and n/10n / 10 to remove it.