Skip to content

Instantly share code, notes, and snippets.

View BhoiDanny's full-sized avatar

Cypherios BhoiDanny

View GitHub Profile
@BhoiDanny
BhoiDanny / Session.php
Created November 24, 2023 07:43
Session Implementation
<?php /** @noinspection PhpIllegalPsrClassPathInspection */
namespace SannyTech;
class Session
{
private mixed $user_id;
private mixed $admin_id;
public string $message;
private bool $signedIn = false;
@BhoiDanny
BhoiDanny / divide.cpp
Created October 20, 2023 01:52
While Loop with break and continue statement
#include <iostream>
using namespace std;
int main() {
//Step 1
int a = 0;
int number = 1;
@BhoiDanny
BhoiDanny / prime.cpp
Created October 20, 2023 01:13
Prime Number with For Loop
#include <iostream>
using namespace std;
int main() {
int number;
cout << "Enter Number:";
cin >> number;
for(int a = 2; a <= number; a++) {
#include <iostream>
using namespace std;
// Linear Search
int linearSearch(int arr[], int n, int target) {
for (int i = 0; i < n; i++) {
if (arr[i] == target) {
return i; // Return the index if found
}
}
@BhoiDanny
BhoiDanny / algorithmn.cpp
Created August 15, 2023 13:34
Data structures & Algorithm
#include <iostream>
class Array {
private:
int *arr;
int size;
int capacity;
public:
Array(int capacity) {
@BhoiDanny
BhoiDanny / maxval.cpp
Created August 15, 2023 13:22
program that defines a function Maximum to determine the maximum value in an array of 10 values
#include <iostream>
using namespace std;
// Function to find the maximum value in an array
int maximum(const int array[], int size) {
int maxVal = array[0]; // Assume the first element is the maximum
for (int i = 1; i < size; ++i) {
if (array[i] > maxVal) {
maxVal = array[i]; // Update maxVal if a larger element is found
@BhoiDanny
BhoiDanny / elements.cpp
Created August 15, 2023 13:12
C++ program with an array of 200 elements of integer datatype
#include <iostream>
using namespace std;
int main() {
int arr {200};
//declaring arrays to keep elements
int elements[arr];
int ltelems[arr];
@BhoiDanny
BhoiDanny / index.html
Last active May 20, 2023 07:04
Write a html and javascript code to create a form and perform validation on for the figure below. This form has four input fields: name, email, password, and confirmPassword, the validateForm() function is called when the form is submitted, and it checks if all the fields are filled out correctly. if a field is not filled out correctly , an aler…
<!DOCTYPE html>
<html>
<head>
<title>Form Validation Example</title>
<script>
function validateForm() {
var name = document.forms["myForm"]["name"].value;
var email = document.forms["myForm"]["email"].value;
var password = document.forms["myForm"]["password"].value;
var confirmPassword = document.forms["myForm"]["confirmPassword"].value;
@BhoiDanny
BhoiDanny / form-double.html
Created May 18, 2023 05:46
Use html form tags and controls to generate the output
<!DOCTYPE html>
<html lang="en">
<head>
<title>@Grace</title>
</head>
<body>
<form>
<fieldset>
<legend>Your Details</legend>
@BhoiDanny
BhoiDanny / form.html
Created May 18, 2023 05:42
MY FIRST HTML PAGE ON TABLES AND FORMS
<!DOCTYPE html>
<html lang="en">
<head>
<title>HTML Tables and Forms</title>
<style>
table {
border: 1px solid black;
}
tr,td,th {
border: 1px solid black;