Notes, summaries, assignments, exams, and exercises for Computer science for Secondary education

Gestión de Pedidos en Java y MySQL con ClasePedido

Computer science5.35 KB

Gestión de Pedidos en Java con MySQL y Swing

La clase ClasePedido permite gestionar pedidos, interactuar con bases de datos relacionales MySQL a través de JDBC y vincular los datos con componentes gráficos de Java Swing mediante DefaultTableModel.

Código Fuente de ClasePedido

import java.sql.*;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JOptionPane;
import javax.swing.table.*;

public class ClasePedido {
private static Connection cn = null;
private Statement st = null;
private ResultSet rs = null;
beanClientes cliente = new beanClientes();
DefaultTableModel datos = new DefaultTableModel();
beanProductos productos = new beanProductos();
...
Continue reading "Gestión de Pedidos en Java y MySQL con ClasePedido" »

Java JDBC Database Connection and Client Management Class

Computer science3.11 KB

Java Database Client Management Class

Below is the complete implementation of the beanClientes Java class designed to handle database connections, search client records by telephone, generate unique client codes, and insert new records using JDBC and Java Swing.

Source Code Implementation

import java.sql.*;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JOptionPane;

public class beanClientes {
    private static Connection xcn = null;
    private Statement xst = null;
    private ResultSet xrs = null;
    private String xcod, xnom, xdir, xref, xtel;

    public void EnlasaBeanClientes(Connection cn) {
        try {
            xcn = cn;
            xst = xcn.createStatement();
        } catch (SQLException
...
Continue reading "Java JDBC Database Connection and Client Management Class" »

Mastering HTML Special Characters and Entity Codes

Computer science3.08 KB

Symbols: Why Do You Use Codes?

There are several operating systems in the world of computers. These systems are nothing but special programs that run immediately after turning on the computer and are in charge of giving "life" to the machine.

Along with these programs, computers load special tables into memory that match the characters present on a keyboard and a few others that are not, but can be entered online by other means. These tables, unfortunately, are not always the same and vary from one system to another, from one brand of computer to another, and of course, from one language to another. For example, accented letters from a PC are not like those from a Macintosh or a UNIX terminal when typing directly from the keyboard.

Universal Language

...
Continue reading "Mastering HTML Special Characters and Entity Codes" »

Understanding Computer Fundamentals: FAQ

Computer science3.72 KB

What is a Computer?

A computer is an information processing machine capable of storing a large amount of data.

What is an Abacus?

The Abacus was a device capable of performing automatic calculations.

What is the Computer's Brain?

The computer's brain is the microprocessor.

What is Multimedia?

Multimedia is the ability to use images and sound through the computer.

What is the Internet?

The Internet is a network that allows access to information stored on computers.

What is Compatibility?

Compatibility refers to the ability of different components or software to work together.

What is a Power Supply?

The power supply is a component that connects your computer to the electric current.

What is the Motherboard?

The motherboard is the main circuit board of a computer,...

Continue reading "Understanding Computer Fundamentals: FAQ" »

Recuperar datos con POST y REQUEST en PHP y MySQL

Computer science4.54 KB

Recuperar datos con POST en PHP

POST-REQUEST nos permite recuperar datos enviados desde formularios con el método POST.

En HTML

<!DOCTYPE html>
<html>
<head><title>Ejemplo aprenderaprogramar.com</title>


Nombre: <input type="text" name="nombre" value="">

En PHP (para enviar mensaje)

<?php
$nombre = $_POST['nombre'];
$apellidos = $_POST['apellidos']; (opcional)
$telefono = $_POST['celular'];
$edadPersona = $_POST['edad'];
echo "<br/> &nbsp; El nombre es". $nombre. ;

REQUEST con condición If

if (!empty($_POST['nombre']) && !empty($_POST['comentario'])
$nombre = $_REQUEST['nombre'];
$comentario = $_REQUEST['comentario'];
echo "<p>Gracias, $nombre, por su comentario</p>";
echo "<p>$comentario&...

Continue reading "Recuperar datos con POST y REQUEST en PHP y MySQL" »

Java Student Grade Management System: Courses, Students and Grades

Computer science4.2 KB

Java Student Grade Management System

This Java console application lets you manage courses, students and grades through an interactive menu. The corrected code below uses valid for loop syntax and the proper switch structure.

Main Menu

  • 1 Cursos
  • 2 Estudiantes
  • 3 Notas
  • 4 Salir

Source Code

import java.io.*;
public class PruebaCasa {
BufferedReader in;
String cur[];
String estu[];
int auxcur,auxestu;
int notas[];
float prome[];
int opcion,opcion1,totalc,totalestu;

public PruebaCasa() throws IOException {
in = new BufferedReader(new InputStreamReader(System.in));
Menu();
}

public static void main(String args[]) throws IOException {
PruebaCasa obj = new PruebaCasa();
}

public void Menu() throws IOException {
do {
System.out.println("1 Cursos");
System.
...
Continue reading "Java Student Grade Management System: Courses, Students and Grades" »

180 Essential Excel Shortcuts for Windows

Computer science220.94 KB

Cheat Sheets N More

180 Essential Excel Shortcuts for PC

Master Anything Faster · Cheat Sheets N More

Microsoft Windows Edition

200 Shortcuts

Part 1: Absolute Basics

Moving Around

  • Move one cell in any direction: Arrow Keys
  • Confirm entry and move down: Enter
  • Confirm entry and move up: Shift + Enter
  • Move one cell to the right: Tab
  • Move one cell to the left: Shift + Tab
  • Move down one screen: Pg Dn
  • Move up one screen: Pg Up
  • Move one screen to the right: Alt + Pg Dn
  • Move one screen to the left: Alt + Pg Up
  • Move to first column in row: Home

Important Places

  • Go to cell A1: Ctrl + Home
  • Go to last used cell: Ctrl + End
  • Jump to edge of data region: Ctrl + Arrow
  • Select to edge of data region: Ctrl + Shift + Arrow
  • Open Go To dialog: F5
  • Open Go To (alternate): Ctrl + G

Selecting Cells

  • Extend selection
...
Continue reading "180 Essential Excel Shortcuts for Windows" »

Singly Linked List in C: Create, Insert, Count and Concatenate Nodes

Computer science4.45 KB

Singly Linked List of Integers in C

The following C program implements a singly linked list of integers. It defines a node structure, several functions to create and manage nodes, and some functions still to be implemented in the practical class.

/* List of integers */

#include <stdio.h>
#include <stdlib.h>

struct nodo{
    int valor;
    struct nodo *prox;
};
typedef struct nodo *t_ptr_nodo;
// In class
// returns an empty list
t_ptr_nodo lista_vacia();
// returns 0 when list is empty, any other number otherwise
int es_lista_vacia(struct nodo* head);
struct nodo* crea_nodo_1(int info);
// notice that is the same as: t_ptr_nodo crea_nodo_1(int info);
void crea_nodo_2(struct nodo **lista, int info);
// notice that is the same as:
...
Continue reading "Singly Linked List in C: Create, Insert, Count and Concatenate Nodes" »

Calculadora Core: Herramienta Web con Operaciones Matemáticas

Computer science5.39 KB

Calculadora Core





acumulador = 0;
operador = "";

const vaciar = () => {
  document.getElementById("pantalla").value = "";
};

const rellenar = (y) => {
  document.getElementById("pantalla").value = y;
};

const numero = () => Number(document.getElementById("pantalla").value);

const numeros = () => {
  const t = document.getElementById("pantalla").value;
  const st = t.split(",");
  st.forEach(y => console.log(y));
};

/*const validar = () => {
  if (Number.isNaN(numero())) {
    document.getElementById = "Error";
    rellenar("Error");
    return false;
  } else {
    return true;
  }
};*/

const validar = (content) => {
  if (content.includes(",")) {
    let lista = content.split(",");
    return lista.every((elem) =>
...
Continue reading "Calculadora Core: Herramienta Web con Operaciones Matemáticas" »

The 7 Layers of the OSI Model Explained for Networking Professionals

Computer science5.35 KB

The 7 Layers of the OSI Model

The Open Systems Interconnection (OSI) model defines a networking framework to implement protocols in seven distinct layers. Understanding these layers is fundamental to grasping how data communication occurs across networks.

Application Layer (Layer 7)

The Application Layer, OSI Model Layer 7, supports application and end-user processes. Key functions include identifying communication partners, defining quality of service, considering user authentication and privacy, and identifying any constraints on data syntax. Everything at this layer is application-specific.

This layer provides application services for file transfers, e-mail, and other network software services. Examples of applications existing entirely at this...

Continue reading "The 7 Layers of the OSI Model Explained for Networking Professionals" »