Skip to content

Instantly share code, notes, and snippets.

View Thraax's full-sized avatar
🏠
Working from home

Yusuf Taha Thraax

🏠
Working from home
View GitHub Profile
@Thraax
Thraax / documentDistance.cpp
Created October 22, 2020 16:47
Document distance alogrithm - C++
#define _USE_MATH_DEFINES
#include <iostream>
#include <vector>
#include <cmath>
using namespace std;
double dotProduct(vector <string> word1 , vector <string> word2) {
@Thraax
Thraax / findPeak1D.cpp
Last active October 21, 2020 23:10
FindPeak_1D
void findPeak_1D(int list[], int size) {
if (list[ (size / 2) + 1] > list[size / 2] ){
for (int i = (size / 2) + 1; i < size; i++) {
cout << i << endl;
if ((list[i] >= list[i - 1]) && (list[i] >= list[i + 1])) {
cout << list[i] << " is the peak\n";
@Thraax
Thraax / Peak2D.cpp
Last active February 1, 2021 10:50
Peak-Finder algorithm with 2D array
void findPeak_2D(int matrix[][4], int rows) {
int row = 0;
int col = 4 / 2;
bool founded = false;
while (!founded) {
@Thraax
Thraax / Pizza_Resturant.cpp
Created May 3, 2019 12:34
Program for pizza resturant
#include <iostream>
#include <string>
using namespace std;
int main()
{
//==================================================== VARIABLES ====================================================//
int Order;
int Quantity;
char Size;
@Thraax
Thraax / Playstation.cpp
Created February 24, 2019 07:28
Playstation program calculate client account.
#include <iostream>
#include <string>
using namespace std;
struct Devices
{
int Dev_type;
int Game_Name;
float hours;
int drinks;
@Thraax
Thraax / Booker.cpp
Created January 31, 2019 05:42
Program can book a flight tickets
#include <iostream>
#include<string>
using namespace std;
static int flight_num=1;
//function of tickets
void issue_ticket (int flight_num , int ticket_num, string name)
{
cout<<" \t \t ***************************** \n";
@Thraax
Thraax / Sphpere.cpp
Created January 30, 2019 17:55
Calculate the area and volume of sphere
#include <iostream>
#include<string>
using namespace std;
double sphere_area(double radius);
double sphere_volume(double radius);
const double Pi = 3.14;
int main()
{
int operat;
@Thraax
Thraax / Calculator.cpp
Last active September 13, 2019 04:25
Calculator by C++
#include <iostream>
using namespace std;
int main()
{
double Num1;
double Num2;
int Operation;
int Reply;
@Thraax
Thraax / pow.py
Last active November 28, 2018 17:41
calculate the power without function
i=0
multi=1
x=int(input("enter the number \n"))
y=int(input("enter the power \n"))
while i<y :
multi = multi*x
i = i+1
print(multi)