Posts

10 sdc

 PROGRAM 10. Develop an express web application that can interact with REST API to perform1 4 CRUD operations on student data. (Use Postman). Server.js const express = require('express'); const app = express(); app.use(express.json()); let students = []; // CREATE app.post('/students', (req, res) => {     const student = {         id: students.length + 1,         name: req.body.name,         course: req.body.course     };     students.push(student);     res.send("Student Added Successfully"); }); // READ app.get('/students', (req, res) => {     res.json(students); }); // UPDATE app.put('/students/:id', (req, res) => {     const id = parseInt(req.params.id);     const student = students.find(s => s.id === id);     if(student){         student.name = req.body.name;         student.course = req....

Sdc

 OGRAM 2: Make the above web application responsive web  application using Bootstrap framework.  bootstrap.html  <html>  <head>  <meta charset="UTF-8">  <meta name="viewport" content="width=device-width, initial-scale=1.0">  <title>Bootstrap usage</title>  <link  href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.8/dist/css/bootstrap.mi n.css" rel="stylesheet" integrity="sha384- sRIl4kxILFvY47J16cr9ZwB07vP4J8+LH7qKQnuqkuIAvNWLzeN8tE5YBujZqJ LB" crossorigin="anonymous">  </head>  <body>  <main>  <h1 class="container mt-5">Login Here</h1>  <form class="mb-3" action="#">  <label class="form-label">EMAIL</label><input type="text" class="form- control" id="email" name="email">  <label class="form-label" >PASSWORD</label><input...

BANKING SYSYTEM DATABASE WITH RECORDS

Creation of the Database              RED COLOUR : DEFALUT COMMAND   mysql> create database 05D8;                                     GREEN COLOUR : OUTPUT Query OK, 1 row affected (0.12 sec) useing if the database mysql> use 05D8; Database changed CREATING THE TABLE mysql> CREATE TABLE Bank(Bank_ID varchar(20) primary key,Bank_Name VARCHAR(255),Bank_Address VARCHAR(255),Bank_Phone VARCHAR(15)); Query OK, 0 rows affected (0.58 sec) mysql> CREATE TABLE Branch(Branch_ID varchar(25) PRIMARY KEY,Branch_Name VARCHAR(255),Branch_Address VARCHAR(255),Branch_Phone VARCHAR(15),Bank_ID varchar(25),FOREIGN KEY(Bank_ID)REFERENCES Bank(Bank_id)); Query OK, 0 rows affected (0.80 sec) ad more mysql> CREATE TABLE Customer(Customer_ID varchar(25...

multi therad randon number odd or even

  file name :Multithreadrandoddeven. java import java.util.*; // class for Even Number class EvenNum implements Runnable {       public int a;       public EvenNum(int a) {           this.a = a;       }       public void run() {           System.out.println("The Thread "+ a +" is EVEN and Square of " + a + " is : " + a * a);       } } // class for Odd Number class OddNum implements Runnable {       public int a;       public OddNum(int a)  {           this.a = a;       }       public void run()  {           System.out.println("The Thread "+ a +" is ODD and Cube of " + a + " is: " + a * a * a);       } } // class to generate random number class RandomNumGenerator extends Thread  {       public void run(...

text to table program

  file name:Texttable.java import java.io.*; import java.util.*; import java.awt.*; import java.awt.event.*; import javax.swing.*; import javax.swing.event.*; class Text_To_Table extends JFrame { public void convertTexttotable() { setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE); setSize(400,300); GridLayout g = new GridLayout(0, 4); setLayout(g); try { FileInputStream fis = new FileInputStream("./Table.txt") ; Scanner sc = new Scanner(fis); String[] arrayList; String str; while (sc.hasNextLine()) {  str = sc.nextLine();  arrayList = str.split(",");  for (String i : arrayList)                 {                     add(new Label(i));                 }             }         }  catch (Exception ex) { ex.printStackTrace();         }         setVisible...

Binary search tree

 program:   #include <stdio.h> #include <stdlib.h> struct node {     int key;     struct node *left, *right; }; struct node *newNode(int item) {     struct node *temp = (struct node *)malloc(sizeof(struct node));     temp->key = item;     temp->left = temp->right = NULL;     return temp; } void inorder(struct node *root) {     if (root != NULL) {         inorder(root->left);         printf("%d -> ", root->key);         inorder(root->right);     } } void preorder(struct node *root) {     if (root != NULL) {         printf("%d -> ", root->key);         preorder(root->left);         preorder(root-...

DFS

  #include <stdio.h> int a[20][20], visited[20], n; void dfs(int v) {     int i;     visited[v] = 1;     printf("Visited %d\n", v);     for (i = 1; i <= n; i++)     {         if (a[v][i] && !visited[i])         {             printf(" %d->%d\n", v, i);             dfs(i);         }     } } int main()  {     int i, j, v;     printf("Enter number of vertices: ");     scanf("%d", &n);     for (i = 1; i <= n; i++)     {         visited[i] = 0;         for (j = 1; j <= n; j++)             a[i][j] = 0;     }     printf("Enter the adjacency matrix:\n");     for (i = 1; i <= n; i++)         for (j = 1; j <=...