Untitled

Choose a study mode

Play Quiz
Study Flashcards
Spaced Repetition
Chat to Lesson

Podcast

Play an AI-generated podcast conversation about this lesson

Questions and Answers

In the context of program development, what is the primary purpose of 'Evaluation'?

  • To assess if the program meets its objectives and is resilient under various conditions. (correct)
  • To determine the aesthetic appeal of the user interface.
  • To speed up the execution time of the software.
  • To minimize the amount of code written for the program.

Which of the following best describes the 'Processes' stage in program development?

  • The hardware requirements needed to run the program.
  • The steps the program takes to manipulate and transform the inputted data. (correct)
  • The initial planning phase outlining the project timeline.
  • The method of gathering user feedback after the program is launched.

A programmer is using a structure diagram. What is its main function?

  • To convert the source code into machine code.
  • To divide a complex problem into more manageable parts. (correct)
  • To create a visual representation of the program's user interface.
  • To optimize the program's memory usage.

What is the key role of a flowchart in software development?

<p>Depicting program operations and data movement. (D)</p> Signup and view all the answers

During which stage of program development might you revisit previous stages based on new information?

<p>Any stage, as it is an iterative process. (B)</p> Signup and view all the answers

A photographer wants to store high-quality photographs with transparency. Which image format is most suitable?

<p>PNG (D)</p> Signup and view all the answers

Which of the following changes would reduce the file size of an image while maintaining acceptable quality?

<p>Decreasing the colour bit depth. (D)</p> Signup and view all the answers

What is the primary reason for compressing files before sending them over the Internet?

<p>To reduce the transmission time and bandwidth usage. (D)</p> Signup and view all the answers

A graphic designer needs to archive a set of images. Which combination of settings will result in the highest quality images while minimizing file sizes?

<p>High resolution, high colour bit depth, lossless compression. (D)</p> Signup and view all the answers

Which factor has the most significant impact on the file size and perceived quality of a digital audio recording?

<p>The sampling rate used during digital conversion. (B)</p> Signup and view all the answers

A musician is recording a song. What adjustment should be made to the sampling rate to capture more nuances in the music?

<p>Increase the sampling rate to capture more detail. (A)</p> Signup and view all the answers

Which of the following scenarios illustrates the need for file compression?

<p>A teacher needs to email a large video file to students with limited internet access. (C)</p> Signup and view all the answers

A video editor needs to reduce the file size of a video to upload it to a video-sharing website, but without significantly impacting the viewing experience. Which approach should the video editor take?

<p>Decrease the video resolution and use lossy compression. (D)</p> Signup and view all the answers

Consider the expression age > 65 AND retired == True. Under what condition will this expression evaluate to True?

<p>When the person is older than 65 and is also retired. (D)</p> Signup and view all the answers

Given the condition NOT (city == 'New York'), which of the following scenarios would evaluate to True?

<p>When the city is not equal to 'New York'. (C)</p> Signup and view all the answers

What is the difference between the = and == operators?

<p><code>=</code> is used for assignment, while <code>==</code> is used for comparison. (C)</p> Signup and view all the answers

Which of the following expressions evaluates to True if a student is enrolled in either class 1 or class 2, but not both?

<p><code>class == 1 OR class == 2</code> (D)</p> Signup and view all the answers

Under what circumstance will the condition age < 18 AND status != 'minor' evaluate to True?

<p>When the person is under 18 and their status is not 'minor'. (C)</p> Signup and view all the answers

What would be the result of the expression (x > 5) OR (y < 10) if x = 3 and y = 12?

<p><code>False</code> (A)</p> Signup and view all the answers

If isAdmin = False, what will NOT isAdmin evaluate to?

<p><code>True</code> (A)</p> Signup and view all the answers

Choose the correct operator to check if the variable score is exactly equal to 100.

<p>score == 100 (C)</p> Signup and view all the answers

What is the primary purpose of an EQUI-JOIN operation in SQL?

<p>To display results from two different tables by linking them through primary and foreign keys. (A)</p> Signup and view all the answers

What will be the outcome if a DELETE statement is executed without a WHERE clause?

<p>All records from the table will be deleted. (D)</p> Signup and view all the answers

Consider the SQL statement: SELECT firstname, surname FROM student WHERE year > 3. What information does this query retrieve?

<p>First names and surnames of students in years greater than 3. (A)</p> Signup and view all the answers

Why is documenting expected results important when testing SQL queries?

<p>To ensure that the actual results match the intended outcome and to verify the query's correctness. (D)</p> Signup and view all the answers

What is the function of the AND operator in a SQL WHERE clause?

<p>To include records that match both of the specified conditions. (D)</p> Signup and view all the answers

In an EQUI-JOIN operation, what happens if there are no matching entries between the primary key in one table and the foreign key in another?

<p>The query will return only rows where there is a match between the primary and foreign keys. (C)</p> Signup and view all the answers

Consider the following SQL query:

SELECT * FROM employees WHERE salary > 50000 AND department = 'Sales';

What is the purpose of this query?

<p>To select all employees with a salary greater than 50000 in the Sales department. (A)</p> Signup and view all the answers

If given the tables 'students' and 'courses', what SQL statement would list the firstname, surname from the student table and the course name from the courses table for students with a StudentID less than 4?

<p><code>SELECT firstname, surname, courseName FROM students JOIN courses ON students.StudentID = courses.StudentID WHERE students.StudentID &lt; 4</code> (A)</p> Signup and view all the answers

What would happen if the WHERE clause was omitted from this SQL statement?

DELETE FROM pupils WHERE firstName = 'Eva' AND surname = 'Forrest';

<p>All records in the <code>pupils</code> table would be deleted. (A)</p> Signup and view all the answers

During program execution, what is the immediate consequence of encountering a syntax error?

<p>The interpreter identifies the error, preventing the code from running. (C)</p> Signup and view all the answers

Which type of error would likely occur if a program attempts to calculate 5 / x when x is equal to 0?

<p>Execution error (B)</p> Signup and view all the answers

A program is designed to calculate the area of a rectangle but consistently outputs incorrect values due to using addition instead of multiplication. What type of error is present?

<p>Logic error (C)</p> Signup and view all the answers

Which error type is typically addressed through thorough testing and debugging procedures?

<p>Logic errors (B)</p> Signup and view all the answers

What distinguishes a syntax error from an execution error in programming?

<p>A syntax error prevents compilation or interpretation; an execution error occurs while the program is running. (D)</p> Signup and view all the answers

If a program compiles and runs but produces output that does not align with the intended functionality, what type of error is most likely present?

<p>A logic error. (C)</p> Signup and view all the answers

A programmer forgets to close a parenthesis in an expression. Which type of error will this cause?

<p>Syntax error (D)</p> Signup and view all the answers

A program is designed to store an integer value, but due to a coding mistake, it attempts to store a string. What type of error is likely to occur?

<p>Execution error (B)</p> Signup and view all the answers

What would be the value of numWord after executing the statement SET numWord TO LENGTH(word) if word is assigned the string "Programming"?

<p>11 (B)</p> Signup and view all the answers

What is the purpose of the RANDOM(1, 59) function?

<p>Generates a random integer between 1 and 59, inclusive. (B)</p> Signup and view all the answers

What is printed to the display if the user initially enters 150 for score in the provided pseudocode?

<p>&quot;In-Valid&quot; (B)</p> Signup and view all the answers

How many times will the loop iterate in the following code snippet:

SET total TO 0
FOR counter 0 TO 5
  GET itemPrice FROM (REAL) KEYBOARD
  SET total = total + itemPrice
END FOR

<p>6 (A)</p> Signup and view all the answers

What is the purpose of the WHILE loop condition score < 1 OR score > 100?

<p>To ensure the score is within the valid range of 1 to 100 inclusive. (A)</p> Signup and view all the answers

In the context of the pseudocode provided, what is meant by 'traversing' a 1-D array?

<p>Accessing each element in the array. (A)</p> Signup and view all the answers

Consider the code for calculating the total price. What data type should itemPrice be to accurately represent prices with decimal values?

<p><code>REAL</code> (D)</p> Signup and view all the answers

What is the initial value of the total variable before the FOR loop begins?

<p>0 (B)</p> Signup and view all the answers

If the user enters the following item prices: 1.50, 2.50, 3.50, 4.50, 5.50, and 6.50, what will be the final value of the total variable?

<p>24.00 (A)</p> Signup and view all the answers

Which of the following is a direct benefit of validating user input, as demonstrated by the WHILE loop example?

<p>Prevents the program from using invalid data, which could cause errors or incorrect calculations. (A)</p> Signup and view all the answers

Instead of a FOR loop, could a WHILE loop be used to achieve the same result for accumulating the total price of items? Why or why not?

<p>Yes, a <code>WHILE</code> loop could be used, but it requires manually managing the loop counter, making it more complex. (A)</p> Signup and view all the answers

What modification would allow the program to accept scores between 0 and 100 (inclusive)?

<p>Change the <code>WHILE</code> condition to <code>score &lt; 0 OR score &gt; 100</code> (B)</p> Signup and view all the answers

If the goal is to sum prices from a dynamically sized array (unknown number of items), which loop type is most appropriate?

<p>A <code>FOR</code> loop that iterates over the indices of the array, using the array's length to determine the upper bound. (A)</p> Signup and view all the answers

What happens if the data type specified in GET itemPrice FROM (REAL) KEYBOARD does not match the actual data type entered by the user?

<p>The program may crash or produce unpredictable results, depending on the language and implementation. (B)</p> Signup and view all the answers

What is the significance of the END FOR statement in the provided pseudocode?

<p>It signifies the end of the loop's block of code, after which the loop counter increments and the loop possibly repeats. (B)</p> Signup and view all the answers

Flashcards

What is a PNG file?

Lossless image format supporting animation, transparency and up to 48-bit color.

What is graphic resolution?

The number of pixels per inch in an image.

How does graphic resolution affect file size?

More pixels per inch lead to better quality but increases file size.

What is color bit depth?

The number of bits used to represent each color in an image.

Signup and view all the flashcards

How does color bit depth affect file size?

More colors, but increases file size.

Signup and view all the flashcards

What is sampling rate?

The number of audio samples taken per second.

Signup and view all the flashcards

How does sampling rate affect file size?

More samples lead to more realistic sound but increases file size.

Signup and view all the flashcards

Why is compression needed?

Reducing file size saves storage and reduces transfer time.

Signup and view all the flashcards

Evaluation (in programming)

Determines if a the program is suitable for its intended use and is reliable under various conditions.

Signup and view all the flashcards

Program Inputs

Data provided to a program, which it then processes to produce a result.

Signup and view all the flashcards

Program Processes

The actions or operations a program performs on the input data.

Signup and view all the flashcards

Program Output

The result a program produces after processing the input data.

Signup and view all the flashcards

Structure Diagrams

A diagram method that decomposes complex problems into distinct smaller sections.

Signup and view all the flashcards

SQL DELETE

Removes records from a table.

Signup and view all the flashcards

DELETE FROM table (no WHERE)

Deletes all records from a table.

Signup and view all the flashcards

SQL EQUI-JOIN

Joins data from two tables based on a related column.

Signup and view all the flashcards

EQUI-JOIN Requirements

Links tables using primary and foreign keys.

Signup and view all the flashcards

SQL AND Operator

Both conditions must be true.

Signup and view all the flashcards

SQL OR Operator

At least one condition must be true.

Signup and view all the flashcards

SQL > Operator

Used to filter results based on a value that is greater than a specified value.

Signup and view all the flashcards

Testing Queries

Comparing expected outcomes with actual results when testing SQL commands.

Signup and view all the flashcards

Verifying SQL Operations

Ensuring SQL operations function correctly.

Signup and view all the flashcards

SQL Join requirements

Specifying requirements such as primary and foreign keys when joining tables

Signup and view all the flashcards

What does the '<' operator mean?

Less than. Returns true if the left operand is less than the right operand.

Signup and view all the flashcards

What does the '>' operator mean?

More than. Returns true if the left operand is greater than the right operand.

Signup and view all the flashcards

What does the '==' operator mean?

Equality. Checks if two values are the same.

Signup and view all the flashcards

What does the '!=' operator mean?

Inequality (Not equal to). Returns true if two values are not the same.

Signup and view all the flashcards

What does the 'AND' operator mean?

Requires both conditions to be true to evaluate to true.

Signup and view all the flashcards

What does the 'OR' operator mean?

Requires at least one of the conditions to be true to evaluate to true.

Signup and view all the flashcards

What does the 'NOT' operator mean?

Reverses the truthiness of a statement. If a condition is true, NOT makes it false and vice versa.

Signup and view all the flashcards

What does the '<=' operator mean?

Compares two values and returns true if the left value is less than or equal to the right value.

Signup and view all the flashcards

Syntax Error

An error in the spelling or grammar of code. The interpreter identifies it, preventing the code from running.

Signup and view all the flashcards

Execution Error

An error occurring when the program tries to perform an impossible action, leading to a crash.

Signup and view all the flashcards

Logic Error

An error in the program's logic, producing unexpected results despite the program running.

Signup and view all the flashcards

Syntax Error example

Misspelt command words in code.

Signup and view all the flashcards

Execution Error example

Attempting to divide a number by zero in the program.

Signup and view all the flashcards

Logic Error example

Using a '<' instead of '>' in a conditional statement.

Signup and view all the flashcards

Syntax error detection

Identified during the coding phase

Signup and view all the flashcards

Logic error detection

Testing via test cases

Signup and view all the flashcards

LENGTH Function

Returns the number of characters in a string.

Signup and view all the flashcards

RANDOM Function

Generates a random number within a specified range (inclusive).

Signup and view all the flashcards

Input Validation

An algorithm to ensures user input falls within acceptable bounds.

Signup and view all the flashcards

Input Validation Loop

Repeatedly prompts the user for input until a valid entry is provided.

Signup and view all the flashcards

Fixed Loop

A loop that executes a predetermined number of times.

Signup and view all the flashcards

Traversing an Array

Accessing each element within an array.

Signup and view all the flashcards

Why traverse an array

To look at them all

Signup and view all the flashcards

Searching an array

Iterating through all elements to find a specific value.

Signup and view all the flashcards

Sorting an array

Rearranging elements into a specific order, either ascending or descending

Signup and view all the flashcards

Sorting an array

Rearranging elements into a specific order, either ascending or descending

Signup and view all the flashcards

Reversing

Changing the order of the elements in an array

Signup and view all the flashcards

Summing

Adding up all the numbers in an array

Signup and view all the flashcards

Max Value

Finding the biggest number in an array

Signup and view all the flashcards

Algorithm

A set of steps to perform a calculation

Signup and view all the flashcards

Boolean Expression

An expression that results in a value of True or False

Signup and view all the flashcards

Study Notes

  • Everything stored by a computer is stored using Binary, indicated by 0 and 1
  • Example: 37 in denary is 00100101 in binary, derived from 0+0+32+0+0+4+0+1

Floating Point Representation

  • The mantissa and exponent are stored as separate numbers
  • The number is recreated for calculations when needed

Extended ASCII Code

  • Each character is represented by an 8-bit ASCII code
  • 'V' is represented as 86, or 01010110 in binary

Vector Graphics

  • Vector graphics store a picture by storing the attributes of each object to draw the shape
  • Rectangle attributes: height, width, x coordinate, y coordinate, fill color, line color
  • Ellipse attributes: cx, cy, rx, ry, fill color, line color
  • Line attributes: x1, y1, x2, y2, line color
  • Polygon attributes: x1, y1, x2, y2, x3, y3, fill color, line color (any shape with 3+ sides)

Bit-mapped Graphics

  • Computers store each pixel in binary
  • The number of bits per pixel depends on the number of colors in the image: more colors require more bits

Computer Architecture Components

  • Control Unit: controls the sequencing of fetching, decoding, and executing instructions
  • Arithmetic Logic Unit: performs all calculations and logical operations
  • Registers: temporary memory locations within the processor

Memory Locations and Buses

  • Each location within RAM has a unique address for reading/writing data correctly
  • Address Bus: identifies the memory location for reading/writing
  • Data Bus: transfers data between the processor and memory

Interpreters and Compilers

  • Interpreter: translates one line of code at a time into machine code and executes immediately and is useful for testing, highlighting errors instantly
  • Compiler: translates the entire program and saves the machine code version for repeated use and useful for program release

Environmental Impact from Computer Systems

  • Approximately two billion computer systems are in use worldwide, each using energy
  • Users should consider ways to reduce unnecessary energy consumption
  • Reducing brightness and activating efficiency mode helps reduce energy consumption

Power Settings

  • Power down settings: power-down after inactivity, control setting for single components
  • Standby: reduces power consumption compared to being fully on

Firewalls

  • Firewalls protect against suspicious access to a computer
  • External access is either granted or denied by the firewall

Encryption

  • Encryption encodes information to be unreadable if intercepted
  • Only the sender and receiver can understand the encrypted information

Website Analysis

  • End-user: the intended audience for the website (e.g., children, employees)
  • Functional requirements: features the website must have (e.g., search a database)

Website Structure

  • Linear: users move sequentially from page to page
  • Hierarchical: page access depends on position within the hierarchy

Wireframing

  • Wireframing is for designing visual web page layouts, showing:
  • Navigational links: internal (within site), external (to another site)
  • Absolute addresses: full URL
  • Relative addresses: URL based on the current location

Website Consistency

  • Maintain consistent design rules across all pages
  • Relative vertical positioning: placement of text, graphics, audio, and video
  • File formats: choice of media formats (text, graphics, video, audio)
  • Protects text, graphics, video, and audio within a website
  • Prevents unauthorized copying, use, or distribution without the owner's permission

Standard File Formats

  • Audio:
  • wav: uncompressed, high quality, large file size
  • mp3: lossy compression, good quality, smaller file size
  • Graphics:
  • jpeg: lossy compression, no transparency/animation
  • gif: lossless compression, animation/transparency, 8-bit
  • png: lossless compression, animation/transparency, 48-bit
  • Graphic Resolution: more pixels per inch means better quality, larger file sizes
  • Color Bit Depth: more bits per color means more colors, larger file sizes
  • Sampling Rate: more samples per second means more realistic audio, but larger file sizes

Need for Compression

  • Reduces file size for storage and faster transfer online

Prototyping

  • A draft interface is produced early in development
  • It resembles the intended look and feel of the final product

Cascading Style Sheets (CSS)

  • CSS defines web page colors, fonts, and layout:
    • Internal Stylesheet: CSS code within the section of an HTML file
    • External Stylesheet: CSS in a separate file, linked to the HTML document
  • Selectors: target HTML elements for styling using syntax such as H1 {color: blue; font-size: 12px;}
  • ID: A unique identifier for an element, styled via CSS with #
  • Class: applied to multiple HTML tags and styled via CSS with .classname

JavaScript Coding for Mouse Events

  • Script tags enclose javascript code
  • The color changes when the mouse hovers over or away with the ID demo

HTML Code

  • <html> </html>: tells the browser the rest of the document contains HTML
  • <head> </head>: contains information about the page itself – including CSS
  • <title> </title>: title of the webpage, appears on browser tabs.
  • <body> </body>: page content is placed between these tags.
  • <h1> </h1>: creates a heading, there are six different sizes (h1 to h6)
  • <p> </p>: defines a paragraph
  • <div> </div>: used so CSS can be applied to a group of elements
  • <a href = “link url”> link text </a>: creates a hyperlink – can take user to different page/ website
  • <img src = “image url”>: inserts an image.
  • <audio> <source src = “audio url”> </audio>: inserts an audio file
  • <video> <source src = “video url”> </video>: inserts a video file
  • List elements
    • <ol> </ol>: creates an ordered list - numbered
    • <ul> </ul>: created an un-ordered list - bulleted
    • <li> </li>: adds a list item
  • internal and external
  • relative and absolute addressing

Testing

  • Code Examples make use of the above HTML
  • Matches user-interface design
  • Links and navigation function as intended
  • Media (text, graphics, video) displays adequately
  • The goal is consistency among pages

Evaluation

  • Yes, when the website is fit for purpose
  • No, the developer should revisit previous phases in the development process

Database Analysis

  • End-user: what the end user wants to able to do with the database
  • Functional requirements: the tasks the database should perform/ data it should hold

Data Protection Act 1998

  • Ensures personal data is securely held and not shared
  • Businesses must have prior consent, ensure accuracy, use data for limited purposes, and keep data secure

Entity-Relationship Diagrams

  • Entity: a table
  • Attribute: a field
  • The diagram shows how the two relate

Data Dictionary

  • A data dictionary includes the name and description of the attributes in each entity within a database

Attribute Type Examples

  • Text: a combination of text and number e.g. name, address, telephone number
  • Number: whole numbers and decimal numbers
  • Boolean: true or false

Validation

  • Validation makes it more difficult to make mistakes

Examples of Validation

  • Range: ensures data is within a specified lower and upper limit
  • Restricted Choice: limits the entry to a list of options
  • Length Check: restricts the number of characters allowed
  • Presence Check: ensures that the field is not left blank

Relational Databases

  • Foreign key value has a matching value in corresponding primary key.

SQL operations

  • SQL standard for Structured Query Language, it is used to interrogate data
  • SELECT FROM: selects data : SELECT name, gender FROM student;
  • WHERE: returns records that meet condition: SELECT name, gender FROM student WHERE regClass = "1S1";
  • ORDER BY: ascending or descending: ORDER BY age ASC
  • INSERT INTO: adds a record to a table
  • UPDATE: modifies a current record
  • DELETE: removes records
  • EQUI-JOIN: displays result from two different tables, requires Primary Key & Foreign Key
  • AND: must be true
  • OR: ether must be true
  • "<" less than
  • ">" greater than

SQL Testing

  • Expected results and actual results

Evaluation

  • Requirements met
  • Fit for purpose and accurate output
  • If not, revisit

Software Development process

  • Analysis
  • Design
  • Implementation
  • Evaluation

Functional Requirements

  • Inputs: data entered
  • Processes: what happens to the data
  • Output: the result
  • Software follows the same diagram
  • Flows charts - shows what is going on in a program and how data flows around it

Pseudocode format

  • get age from user*
  • if age < 15?*
  • Send discount to user*
  • else*
  • Send no discount to user*
  • end if*

Studying That Suits You

Use AI to generate personalized quizzes and flashcards to suit your learning preferences.

Quiz Team

Related Documents

More Like This

Untitled
110 questions

Untitled

ComfortingAquamarine avatar
ComfortingAquamarine
Untitled
44 questions

Untitled

ExaltingAndradite avatar
ExaltingAndradite
Untitled
6 questions

Untitled

StrikingParadise avatar
StrikingParadise
Untitled
53 questions

Untitled

ProperMahoganyObsidian avatar
ProperMahoganyObsidian
Use Quizgecko on...
Browser
Browser