Skip to content

Instantly share code, notes, and snippets.

View eforth's full-sized avatar

Ervin Forth eforth

View GitHub Profile
@eforth
eforth / Question3.java
Created June 16, 2019 16:47
Birthday CountDown
/*
Algorithm
1. Enter birthday in following format (yyyy-mm-dd).
2. Check if input is valid.
3. Check if birthday is in the future, if not increase year by 1.
4. Calculate the difference between birthday and current date.
5. Create a while loop that shows a countdown to birthday and
exits when difference becomes zero.
@eforth
eforth / Calculator.java
Created June 9, 2019 17:29
Problem Set #2 - Question #2
package com.company;
/*
Create a Calculator class with members: a and b using the appropriate data type
The Calculator class must implement an interface called Calculable with the following method signatures
double add(double num1, double num2);
double subtract(double num1, double num2);
double multiply(double num1, double num2);
double divide(double num1, double num2);
Create parameterized constructor which initializes the instance variables
@eforth
eforth / Program.java
Created June 9, 2019 16:56
Problem Set #2 - Question #1
package com.company;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Scanner;
public class Program {
static ArrayList<Student> students = new ArrayList<>();
static HashMap<String, Student> studentWithHighestGradeInSubject =
@eforth
eforth / Circle.java
Last active June 16, 2019 17:08
Abstract class
class Circle extends Shape implements Describable {
double radius;
Circle() {}
void getName() {}
void getArea() {}
void getPerimeter() {
System.out.println(2 * PI * radius);
@eforth
eforth / HelloWorld.java
Created April 28, 2019 17:39
Hello World Java
class HelloWorld {
public static void main (String[] args) {
System.out.println("Hello World"):
}
}
@eforth
eforth / index.html
Last active March 19, 2019 00:19
Bank Site
<!DOCTYPE html>
<html>
<head>
<title>Home | PR200 Bank</title>
<link rel="stylesheet" type="text/css" href="styles.css">
</head>
<body>
<section id="navigation-bar">
<div>
@eforth
eforth / email.html
Last active March 3, 2019 16:00
HTML Email Template
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
</head>
<body bgcolor="#e6e6e6">
@eforth
eforth / main.cpp
Created February 26, 2019 16:37
C++ Music Library
#include <iostream>
#include <string>
#include <vector>
using namespace std;
class Song {
private:
string title, artist, album, release_year, genre;
int duration, album_track_number;
public:
@eforth
eforth / index.html
Created February 25, 2019 23:57
CSS float [EXAMPLE]
<!DOCTYPE html>
<html>
<head>
<title>CSS Float</title>
<style>
.col {
float: left;
width: calc(100% / 3 - 40px);
height: 250px;
@eforth
eforth / index.html
Last active February 20, 2019 23:34
Style A WebPage
<!DOCTYPE html>
<html>
<head>
<title>Style A Webpage</title>
<link rel="stylesheet" type="text/css" href="styles.css">
</head>
<body>
<!-- header -->
<header>