Skip to content

Instantly share code, notes, and snippets.

@CodeMaster7000
CodeMaster7000 / Standard Deviation Calculator.c
Created April 23, 2022 15:54
A program which calculates the standard deviation of an individual series using an array of 10 numbers.
#include <math.h>
#include <stdio.h>
float calculateSD(float data[]);
int main() {
int i;
float data[10];
printf("Enter 10 elements:");
printf("\n");
for (i = 0; i < 10; ++i)
scanf("%f", &data[i]);
@CodeMaster7000
CodeMaster7000 / File Generator.cpp
Created April 1, 2022 21:49
A simple file generator coded in C++.
#include <iostream>
#include <fstream>
using namespace std;
int main () {
string fileName;
string fileType;
string fileText;
cout << "Please enter the information in the file >";
@CodeMaster7000
CodeMaster7000 / Simple Calculator C++.cc
Created February 15, 2022 12:08
A simple calculator coded in C++ that performs the 4 basic functions.
# include <iostream>
using namespace std;
int main() {
char op;
float num1, num2;
cout << "Enter operator: +, -, *, /: ";
cin >> op;
@CodeMaster7000
CodeMaster7000 / Multiplication Table Generator.cc
Created February 15, 2022 12:07
A program in C++ which generates a multiplication table based on the input integer and range.
#include <iostream>
using namespace std;
int main()
{
int n, range;
cout << "Enter an integer: ";
cin >> n;
@CodeMaster7000
CodeMaster7000 / Leap Year Checker.cc
Created February 15, 2022 12:06
A program coded in C++ which checks whether the input year is a leap year or not.
#include <iostream>
using namespace std;
int main() {
int year;
cout << "Enter a year: ";
cin >> year;
if (year % 400 == 0) {
@CodeMaster7000
CodeMaster7000 / Factorial Finder.cc
Created February 15, 2022 12:06
A program in C++ which finds the factorial of any positive integer.
#include <iostream>
using namespace std;
int main() {
int n;
long double factorial = 1.0;
cout << "Enter a positive integer: ";
cin >> n;
@CodeMaster7000
CodeMaster7000 / Roots of a Quadratic Equation.cc
Created February 15, 2022 12:05
A program in C++ which finds all roots of a quadratic equation.
#include <iostream>
#include <cmath>
using namespace std;
int main() {
float a, b, c, x1, x2, discriminant, realPart, imaginaryPart;
cout << "Enter coefficients a, b and c: ";
cin >> a >> b >> c;
discriminant = b*b - 4*a*c;
@CodeMaster7000
CodeMaster7000 / Earth.html
Created February 15, 2022 12:03
A stunning 3D Earth in the middle of a space-theme background, coded in HTML.
<a-scene>
<a-camera position='0 0 3' user-height='0'></a-camera>
<a-sphere src="https://raw.githubusercontent.com/aframevr/sample-assets/master/assets/images/space/earth_atmos_4096.jpg" radius="1.5" segments-height="53">
<a-animation attribute="rotation"
dur="10000"
fill= "forwards"
to="0 360 0"
easing="linear"
repeat="indefinite"></a-animation>
</a-sphere>
@CodeMaster7000
CodeMaster7000 / Celsius to Fahrenheit and Vice Versa Converter.sh
Created February 14, 2022 19:34
A Shell script that converts Fahrenheit temperatures into Celsius and vice versa.
echo "*** Converting between different temperature units ***"
echo "1. Convert Celsius temperatures into Fahrenheit"
echo "2. Convert Fahrenheit temperatures into Celsius"
echo -n "Select your choice (1-2): "
read choice
if [ $choice -eq 1 ]
then
echo -n "Enter temperature (C): "
read tc
@CodeMaster7000
CodeMaster7000 / Changing Directory.sh
Created February 13, 2022 20:46
A changing directory bash script.
echo "Enter name of directory: "
read CHDIR
cd $CHDIR