Skip to content

Instantly share code, notes, and snippets.

@CodeMaster7000
CodeMaster7000 / Simple Calculator.sh
Created February 12, 2022 10:25
A simple calculator coded in Shell which performs the 4 basic functions.
echo "Enter two numbers:"
read a
read b
echo "Enter choice:"
echo "1. Addition"
echo "2. Subtraction"
echo "3. Multiplication"
echo "4. Division"
read ch
@CodeMaster7000
CodeMaster7000 / Rainfall Chart.r
Created February 13, 2022 17:19
A line graph coded in R which compares and contrasts the amount of rainfall per month in two cities.
v <- c(7,12,28,3,41)
t <- c(14,7,6,19,3)
plot(v,type = "o",col = "red", xlab = "Month", ylab = "Rainfall (mm)",
main = "Rainfall Chart")
lines(t, type = "o", col = "blue")
@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
@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 / 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 / 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 / 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 / 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 / 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 / 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;