Computing Concepts and the Internet

Choose a study mode

Play Quiz
Study Flashcards
Spaced Repetition
Chat to Lesson

Podcast

Play an AI-generated podcast conversation about this lesson
Download our mobile app to listen on the go
Get App

Questions and Answers

Which action best exemplifies abstraction in computing?

  • Writing a detailed line-by-line commented program
  • Using binary code directly for programming.
  • Simplifying a complex system by breaking it into manageable modules. (correct)
  • Creating a complex algorithm with nested loops.

Why is lossless compression preferred over lossy compression in certain scenarios?

  • Lossless compression maintains the original data integrity. (correct)
  • Lossy compression is better for archival purposes.
  • Lossless compression always results in smaller file sizes.
  • Lossy compression is suitable for text documents.

How does the DNS contribute to user-friendliness on the internet?

  • By preventing DDoS attacks on web servers.
  • By translating domain names into IP addresses (correct)
  • By encrypting data transmitted between servers.
  • By optimizing network speeds for faster data transfer.

An online retail site experiences a sudden surge in traffic from multiple sources, rendering it inaccessible to legitimate users. What type of cyberattack is most likely occurring?

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

What is the primary purpose of metadata in the context of digital images?

<p>To provide information about the image, such as size and resolution. (A)</p> Signup and view all the answers

In the context of data security, what is the key difference between symmetric and public key encryption?

<p>Symmetric encryption uses the same key for encryption and decryption, while public key uses separate keys. (A)</p> Signup and view all the answers

Given the ASCII table, what is the result of the expression 'C' + 3?

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

If char c = 'G' + 32;, what character is stored in c?

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

What is the role of a 'constructor' in object-oriented programming?

<p>To create objects from a class. (D)</p> Signup and view all the answers

What distinguishes a 'static variable' from an 'instance variable' in object-oriented programming?

<p>Static variables are shared among all objects of the class, while instance variables are unique to each object. (B)</p> Signup and view all the answers

Which of the following loop structures is guaranteed to execute its code block at least once?

<p><code>do-while</code> loop (C)</p> Signup and view all the answers

What is the modulo operator (%) primarily used for?

<p>Determining the remainder of a division. (A)</p> Signup and view all the answers

Which of the following is the correct way to declare and initialize a string variable in JavaScript?

<p><code>var myString = &quot;Hello&quot;;</code> (C)</p> Signup and view all the answers

In JavaScript, given the following code:

let x = 5;
let y = "5";
console.log(x == y);
console.log(x === y);

What will be the output?

<p><code>true, false</code> (B)</p> Signup and view all the answers

What is the purpose of the try...catch block in JavaScript?

<p>To handle potential errors during code execution. (C)</p> Signup and view all the answers

Which term describes when algorithms or data reflect existing prejudices in society?

<p>Bias in Computing (B)</p> Signup and view all the answers

How do open source software projects typically encourage collaboration and innovation?

<p>By making the source code freely available for modification and distribution. (B)</p> Signup and view all the answers

Which of the following best describes intellectual property?

<p>Creations of the mind, such as inventions and artistic works. (A)</p> Signup and view all the answers

What is the value of y after the following JavaScript code executes?

let x = 10;
let y = x++;

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

What is the purpose of the following Javascript code?

function reverseString(str) {
  return str.split("").reverse().join("");
}

<p>To reverse a given string. (A)</p> Signup and view all the answers

Which data type is best suited for storing the value 3.14159 in Java?

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

What is the output of the following Java code snippet?

int x = 5;
int y = 2;
double result = (double) x / y;
System.out.println(result);

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

What is the correct syntax to declare an array of integers named numbers with a size of 5 in Java?

<p><code>int[] numbers = new int[5];</code> (D)</p> Signup and view all the answers

What does the following JavaScript code do?

console.log(caesarCipher("hello", 3));

function caesarCipher(str, shift) {
    return str.replace(/[a-zA-Z]/g, (char) => 
        String.fromCharCode(char.charCodeAt(0) + shift)
    );
}

<p>Encrypts the string &quot;hello&quot; using a Caesar cipher with a shift of 3. (D)</p> Signup and view all the answers

Which of the below is the correct definition of an algorithm?

<p>A step-by-step set of instructions to solve a problem (C)</p> Signup and view all the answers

Why is the concept of a 'digital divide' a significant concern in the context of computing?

<p>It creates disparities in access to information and opportunities. (D)</p> Signup and view all the answers

What is the most likely outcome of the following Javascript code?

var score = 75;
if (score >= 90) {
    console.log("A");
} else if (score >= 80) {
    console.log("B");
} else {
    console.log("C");
}

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

What is the meaning of the acronym TCP/IP?

<p>Transmission Control Protocol/Internet Protocol (D)</p> Signup and view all the answers

What is the role of IP addresses in network communication?

<p>To uniquely identify devices on a network. (C)</p> Signup and view all the answers

What is the main purpose of a 'for' loop in Javascript?

<p>To repeat a set of instructions a fixed number of times. (C)</p> Signup and view all the answers

Which data type is most appropriate for storing true/false values in programming?

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

Which of the following best describes how crowdsourcing is commonly used?

<p>Gathering data or contributions from a large group of people. (B)</p> Signup and view all the answers

In JavaScript, what will console.log(5 + '5'); output?

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

How are elements accessed within a list or array?

<p>By their index (A)</p> Signup and view all the answers

What is the term for combining two or more character strings?

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

What does the following code do in Javascript?

image = {
    filename: "photo.jpg",
    size: "2MB",
    resolution: "1920x1080"
};
console.log(image.size);

<p>It creates an image object and prints the size. (D)</p> Signup and view all the answers

What is the result of the expression 17 % 5?

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

In Java, what is the purpose of the keyword new when creating an object?

<p>To allocate memory for a new object. (A)</p> Signup and view all the answers

Flashcards

Algorithm

A step-by-step set of instructions to solve a problem.

Abstraction

Simplifying complex systems by breaking them into layers or hiding details.

Binary

A number system using only 0s and 1s (base-2).

Bit

The smallest unit of data in a computer (0 or 1).

Signup and view all the flashcards

Byte

A group of 8 bits.

Signup and view all the flashcards

Overflow Error

When a number is too large for a system to handle.

Signup and view all the flashcards

Lossy Compression

Reduces file size by removing some data permanently.

Signup and view all the flashcards

Lossless Compression

Reduces file size without losing any data.

Signup and view all the flashcards

Packets

Small chunks of data sent across networks.

Signup and view all the flashcards

IP Address

A unique address assigned to devices on a network.

Signup and view all the flashcards

DNS (Domain Name System)

Translates website names into IP addresses.

Signup and view all the flashcards

TCP/IP

Protocols that manage packet delivery.

Signup and view all the flashcards

HTTP/HTTPS

Protocols used for web communication.

Signup and view all the flashcards

DDoS Attack

Cyberattack that overwhelms a server with traffic.

Signup and view all the flashcards

Phishing

Cyberattack to steal personal information.

Signup and view all the flashcards

Digital Divide

The gap between those with and without access to technology.

Signup and view all the flashcards

Metadata

Data that describes other data.

Signup and view all the flashcards

Big Data

Large datasets used for analysis and decision-making.

Signup and view all the flashcards

Machine Learning

Algorithms that allow computers to learn patterns from data.

Signup and view all the flashcards

Encryption

Encoding data for security purposes.

Signup and view all the flashcards

Decryption

Decoding encrypted data back to its original form.

Signup and view all the flashcards

Public Key Encryption

Uses a public key for encryption and a private key for decryption.

Signup and view all the flashcards

Symmetric Encryption

Same key is used to encrypt and decrypt data.

Signup and view all the flashcards

ASCII

A character encoding system.

Signup and view all the flashcards

Variable

Named storage location for a value.

Signup and view all the flashcards

Data Type

The kind of data a variable holds.

Signup and view all the flashcards

String

A sequence of characters enclosed in quotes.

Signup and view all the flashcards

Boolean

A data type with two values: true or false.

Signup and view all the flashcards

Conditional Statements

if, else, elif used to make decisions in code.

Signup and view all the flashcards

For Loop

Repeats a set of instructions a fixed number of times.

Signup and view all the flashcards

While Loop

Repeats while a condition is true.

Signup and view all the flashcards

Functions

A reusable block of code that performs a task.

Signup and view all the flashcards

List/Array

A collection of elements stored in an indexed format.

Signup and view all the flashcards

Index

The position of an item in a list (starts at 0).

Signup and view all the flashcards

Modulus Operator (%)

Returns the remainder of a division.

Signup and view all the flashcards

Concatenation

Joining two or more strings together.

Signup and view all the flashcards

Crowdsourcing

Gathering data from a large group of people.

Signup and view all the flashcards

Open Source Software

Software whose code is freely available for modification.

Signup and view all the flashcards

Intellectual Property

Creations of the mind protected by copyright or patents.

Signup and view all the flashcards

Bias in Computing

When algorithms or data favor certain groups unfairly.

Signup and view all the flashcards

Study Notes

Computing Concepts & The Internet

  • An algorithm is a step-by-step set of instructions designed to solve a problem.
  • Abstraction simplifies complex systems by dividing them into layers or concealing intricate details.
  • Binary is a base-2 number system that uses only 0s and 1s.
  • A bit is the smallest unit of data in computing, represented as either 0 or 1.
  • A byte consists of a group of 8 bits.
  • An overflow error occurs when a numerical value exceeds the system's capacity to handle it.
  • Lossy compression reduces file size by permanently removing some data. JPEG is an example.
  • Lossless compression reduces file size without any data loss. PNG and ZIP files are examples.
  • Packets are small segments of data transmitted across networks.
  • An IP Address is a unique identifier assigned to each device on a network.
  • DNS (Domain Name System) translates domain names like google.com into IP addresses.
  • TCP/IP (Transmission Control Protocol/Internet Protocol) are protocols governing packet delivery over the internet.
  • HTTP/HTTPS (HyperText Transfer Protocol/Secure) are protocols used for transmitting web data.
  • DDoS (Distributed Denial of Service) attacks flood a server with excessive traffic.
  • Phishing is a cyberattack that employs deceptive emails or websites to steal personal information.
  • The digital divide refers to the disparity in technology access between different groups.

Data & Information

  • Metadata is data providing information about other data, which includes file size and resolution.
  • Big data refers to extremely large datasets utilized for in-depth analysis and informed decision-making.
  • Machine learning involves algorithms that enable computers to learn patterns from data.
  • Encryption is the process of encoding data to ensure its security.
  • Decryption reverses the encryption process, restoring data to its original form.
  • Public key encryption employs separate keys for encryption (public key) and decryption (private key).
  • Symmetric encryption uses the same key for both encryption and decryption.
  • ASCII (American Standard Code for Information Interchange) is a character encoding standard.
  • The ASCII value of '5' is 53, as an integer.
  • The operation '5'-'0' results in 53 - 48 = 5.
  • If char c = 'B'+32, then c stores 'b'.

Programming Fundamentals

  • A variable is a named storage location that holds a value.
  • Data type specifies the kind of data a variable can store, which include integers, strings, and booleans.
  • A string is a sequence of characters enclosed in quotes, such as "Hello".
  • Boolean is a data type with two possible values such as true or false.
  • Conditional statements (if, else, elif) are used to execute different code blocks based on specific conditions.
  • For loops repeat a set of instructions a specified number of times.
  • While loops repeat a set of instructions as long as a condition remains true.
  • Functions are reusable blocks of code designed to perform specific tasks.
  • A list/array is a collection of elements stored in a specific order, accessible by an index.
  • The index is the position of an item in a list, starting from 0.
  • The modulus operator (%) returns the remainder of a division operation.
  • Concatenation is the process of joining two or more strings together.

Global Impact of Computing

  • Crowdsourcing involves collecting data or contributions from a large group of people, such as in Wikipedia.
  • Open-source software is software with freely available source code that can be modified and distributed.
  • Intellectual property refers to creations of the mind, such as inventions, literary, and artistic works. These are protected by law through, for example, patents and copyrights.
  • Bias in computing arises when algorithms or data unfairly favor certain groups.

Java Programming Basics

  • Java is a high-level, object-oriented programming language.
  • A class serves as a blueprint for creating objects in Java, defining their structure and behavior.
  • An object is an instance of a class, possessing attributes and behaviors.
  • A method is a function within a class that defines specific behaviors.
  • A constructor is a special method used to initialize objects when they are created.
  • An instance variable is a variable defined inside a class, unique to each object instance.
  • A static variable is shared among all instances of a class.
  • Primitive types in Java include int, double, boolean, and char.
  • Reference types in Java include String, Array, and Object.
  • Casting is the process of converting a value from one data type to another.

Control Structures & Logic

  • Relational operators are used to compare values (==, !=, >, <, >=, <=).
  • Conditional statements (if, else if, else) allow the execution of different code blocks based on specified conditions.
  • Loops (for, while) are used to repeat a block of code multiple times.
  • Arrays are used to store collections of elements of the same data type.
  • ArrayLists are dynamic arrays that can grow or shrink as needed.

Object-Oriented Programming (OOP)

  • Encapsulation involves bundling data and methods that operate on that data within a class.
  • Inheritance allows a class to inherit properties and methods from another class.
  • Polymorphism enables objects of different classes to be treated as objects of a common type.
  • Abstraction involves simplifying complex systems by breaking them down into smaller, manageable parts.

Algorithms & Data Structures

  • Searching algorithms are used to find a specific element in a collection of data.
  • Sorting algorithms are used to arrange elements in a specific order (e.g., ascending or descending).
  • Data structures are ways of organizing and storing data, such as arrays, linked lists, stacks, and queues.
  • Recursion is a technique where a function calls itself to solve a problem.

Software Development

  • Software development life cycle (SDLC) is a process for planning, creating, testing, and deploying software.
  • Debugging is the process of identifying and fixing errors in code.
  • Testing is the process of verifying that software meets specified requirements.
  • Documentation is the process of creating written materials that describe how software works.

JavaScript Programming

  • JavaScript is a high-level, interpreted programming language primarily used for front-end web development.
  • Variables are declared using var, let, or const.
  • Data types include strings, numbers, booleans, objects, arrays, null, and undefined.
  • Functions are blocks of code that can be defined and called by name.
  • Objects are collections of key-value pairs.
  • Arrays are ordered lists of values.
  • DOM (Document Object Model) is an interface for interacting with HTML and XML documents.
  • Events are actions or occurrences that happen in the browser, such as clicks, mouseovers, and keypresses.
  • Asynchronous programming allows JavaScript to perform tasks in the background without blocking the main thread.
  • AJAX (Asynchronous JavaScript and XML) is a technique for updating parts of a web page without reloading the entire page.

Using APIs

  • APIs (Application Programming Interfaces) allow different software systems to communicate with each other.
  • Fetch API provides an interface for fetching resources, including making HTTP requests.
  • JSON (JavaScript Object Notation) is a lightweight data-interchange format that is easy for humans to read and write.

Topics in JavaScript Code

  • An image object contains metadata such as filename, size, and resolution.
  • Extracting metadata can be done by accessing the object's properties, such as image.size, which outputs "2MB".
  • The Caesar cipher encryption shifts each letter by a fixed number of positions in the alphabet.
  • The example Caesar cipher shifts each character by 3 positions, so "hello" becomes "khoor".
  • Variables can store different data types, such as strings ("Alice"), numbers (25), and booleans (true).
  • Conditional statements (if-else) execute different code blocks based on conditions.
  • Loops (for and while) repeat code blocks multiple times.
  • For loops iterate a specific number of times shown in the example with the variable i which runs from 1 to 5, inclusive.
  • While loops continue as long as a condition is true shown in the example with the variable count which increments to 5.

Studying That Suits You

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

Quiz Team

More Like This

TCP/IP Model and Data Transmission
10 questions

TCP/IP Model and Data Transmission

StraightforwardInsight9160 avatar
StraightforwardInsight9160
TCP/IP Networking Model Quiz
41 questions

TCP/IP Networking Model Quiz

ExcitedMossAgate3075 avatar
ExcitedMossAgate3075
Use Quizgecko on...
Browser
Browser