Notes, summaries, assignments, exams, and problems for Computer science

Java Programming Concepts and Examples

Computer science10.2 KB

Palindrome

  1. Start
  2. Read the string
  3. Calculate the length of the string
  4. Initialize rev
  5. Initialize i=length=1
  6. Repeat until i>=0
    1. rev=rev+char at position I of the string
    2. i=i-1
  7. If string=rev:print “palindrome”
  8. Else print “not palindrome”
  9. Stop

import java.util.Scanner; import java.util.Scanner; class Test { public static void main(String args[]){ Scanner sc = new Scanner(System.in); System.out.print("Enter the String:"); String str = sc.nextLine(); int flag = 0; int len = str.length(); for(int i=0;i


Inheritance

  1. Create a class employee with given variables and method print the salary
  2. Create two sub classes of class employee named officer and manager include the variable specilaization in officer class and department in manager class
  3. Create a class with main
...
Continue reading "Java Programming Concepts and Examples" »

Essential Terminology for Graphic Design, Printing, and Web Projects

Computer science3.55 KB

Core Graphic Design Concepts and Terminology

Vector Graphics and File Types

  • Vector allows for resizing without loss in quality.
  • Vector graphics are smaller in file size.
  • PNG file type (Portable Network Graphics).
  • SVG (Scalable Vector Graphics).

Digital Asset Sourcing

  • He found the images online, but they were in the public domain.
  • The team member created the images himself.

The whole is greater than the sum of the parts.

Typography and Text Handling

  • Kerning: The spacing between specific pairs of characters.
  • Leading: The distance between each line of text.

Font Classifications

  • Script
  • Decorative
  • Serif
  • Sans Serif

Text Overflow

Even though it's not visible, the excess text is still in the bounding area, and a small plus (+) symbol is displayed at the bottom of the...

Continue reading "Essential Terminology for Graphic Design, Printing, and Web Projects" »

C++ Loops and File Handling: A Deep Dive

Computer science4.31 KB

C++ Loops: While, Do-While, and For

While Loop Format

while (condition)
{
    statements(s);
}

How While Loop Works

If the condition is true, the statement(s) are evaluated again. If false, the loop is exited.

While Loop Example

int val = 5;
while (val >= 0)
{
    cout << val << " ";
    val = val - 1;
}

A while loop is a pretest loop (the condition is evaluated before the loop executes).

  • If the condition is initially false, the statement(s) in the body of the loop are never executed.
  • If the condition is initially true, the statement(s) in the body will continue to be executed until the condition becomes false.

The loop must contain code to allow the condition to eventually become false so the loop can be exited. Otherwise, you have...

Continue reading "C++ Loops and File Handling: A Deep Dive" »

Java File Handling: Reading Text and Managing Files

Computer science4.37 KB

Java File Handling Examples: Reading Text and Managing Files

This document presents two distinct Java examples demonstrating fundamental Input/Output (I/O) operations, including reading data from text files and managing file existence and metadata.

Example 1: Reading and Summing Numbers from a Text File

This program reads characters from a file named pepe.txt using FileReader. It attempts to parse and sum numerical values found within the file. Note the specific logic used for character processing and summation.

Java Code: Summing File Contents (EjerciciosFiletexto2)

package ejerciciosfiletexto2;
import java.io.FileReader;
import java.io.IOException;

/**
 *
 * @author thene
 */
public class EjerciciosFiletexto2 {    
    /**
     * @param args
...
Continue reading "Java File Handling: Reading Text and Managing Files" »

Predictive Modeling Techniques in Data Mining

Computer science4.25 KB

CH6

Predictive Modeling Techniques

61) Predictive modeling is perhaps the most commonly practiced branch in data mining. What are three of the most popular predictive modeling techniques?

Answer:

  • Artificial neural networks
  • Support vector machines
  • k-nearest neighbor

62) Why have neural networks shown much promise in many forecasting and business classification applications?

Answer: Because of their ability to "learn" from the data, their nonparametric nature (i.e., no rigid assumptions), and their ability to generalize.

Understanding Neural Networks

63) Each ANN is composed of a collection of neurons that are grouped into layers. One of these layers is the hidden layer. Define the hidden layer.

Answer: A hidden layer is a layer of neurons that takes input...

Continue reading "Predictive Modeling Techniques in Data Mining" »

Sistema de Gestión de Inventario para Concesionarios

Computer science993 bytes

Gestión de Concesionario

Bienvenido al sistema de administración de vehículos. Utilice las siguientes opciones para gestionar su inventario:

Configuración de Base de Datos

El script de inicialización crea la base de datos coches y la tabla ocasion con los campos necesarios: marca, modelo, combustible, color, año y precio.

Formulario de Alta de Vehículos

Datos del Vehículo

Marca: VolvoSaabFiatAudi
Modelo:
Color:

Combustible:

Diesel Gasolina
Año de matriculación:
Precio:

Procesamiento de Datos (PHP)

El archivo Alta.php recibe los parámetros mediante el método GET y realiza la inserción en la base de datos MySQL utilizando la conexión establecida.

Understanding Network Characteristics and Protocols

Computer science5.89 KB

1. The performance of a client-server system is strongly influenced by two major network characteristics: the bandwidth of the network (that is, how many bits/sec it can transport) and the latency (that is, how many seconds it takes for the first bit to get from the client to the server). Give an example of a network that exhibits i) high bandwidth but also high latency, and ii) then give an example of one that has both low bandwidth and low latency. i) High bandwidth but also high latency: A transcontinental fiber link might have many gigabits/sec of bandwidth, but the latency will also be high due to the speed of light propagation over thousands of kilometers. Similarly, a satellite link may run at megabits/sec but have a high latency to...

Continue reading "Understanding Network Characteristics and Protocols" »

The Scrum Guide: Framework for Delivering High-Value Products

Computer science4.04 KB

The Scrum Guide

Framework for developing and sustaining complex adaptive problems, while productively and creatively delivering products of the highest possible value. Scrum is lightweight, simple to understand and difficult to master.

The Scrum Team

The Scrum Team: Self-organizing teams choose how best to accomplish their work, rather than being directed by others outside the team. It is designed to optimize flexibility, creativity, and productivity. It consists of:

  • The Product Owner: Responsible for maximizing the value of the product and the work of the team. Responsible for managing the Product Backlog.
  • The Development Team: Professionals who do the work of delivering a potentially releasable increment of 'Done' product at the end of each Sprint.
...
Continue reading "The Scrum Guide: Framework for Delivering High-Value Products" »

Implementación de Triggers SQL para Gestión de Prácticas y Vehículos

Computer science4.17 KB

Tarea 1: Registrar Kilometraje por Práctica Insertada

Requisito: Crear un TRIGGER donde, cada vez que se inserta una práctica a un alumno, se deben sumar 50 KMS al vehículo que tiene asignado el alumno.

Definición del Trigger PRAC (Inserción de Práctica)

CREATE TRIGGER PRAC
ON PRACTICA
FOR INSERT
AS
    DECLARE @CODMON INT;
    DECLARE @CODAL INT;

    -- 1. Obtener el ID del Monitor asignado al Alumno de la práctica insertada
    SELECT @CODAL = A.CodMon#
    FROM ALUMNO A
    INNER JOIN INSERTED I ON A.CodAl# = I.CodAl#;

    -- Nota: La siguiente selección es redundante o lógicamente incorrecta en este contexto:
    -- SELECT @CODMON = M.CodMon#
    -- FROM MONITOR M
    -- INNER JOIN ALUMNO A ON M.CodMon# = A.CodAl#
    -- WHERE M.
...
Continue reading "Implementación de Triggers SQL para Gestión de Prácticas y Vehículos" »

Understanding Binary Search Trees, Red-Black Trees, AVL Trees, Hash Tables, and HashMaps

Computer science40.07 KB

Binary Search Tree (BST)

Binary search tree (BST) is a tree in which all nodes follow the below mentioned properties:

  1. The left sub-tree of a node has a key less than or equal to its parent node's key.
  2. The right sub-tree of a node has a key greater than or equal to its parent node's key.
  3. Binary search tree (BST) divides all its sub-trees into two segments: left sub-tree and right sub-tree and can be defined as left_subtree (keys) ≤ node (key) ≤ right_subtree (keys).

Red-Black Tree

A red-black tree is a binary search tree in which each node is colored red or black. The root is black. The children of a red node are black. Every path from the root to leaf has the same number of black nodes and all leaves are black.

AVL Tree

Adelson, Velski & Landis

...
Continue reading "Understanding Binary Search Trees, Red-Black Trees, AVL Trees, Hash Tables, and HashMaps" »