Skip to content

Instantly share code, notes, and snippets.

@joeyv
joeyv / Dank.java
Created October 1, 2013 17:34
A dank program to calculate how many gallons of paint you will need to paint a room
import java.util.Scanner;
public class Dank
{
static Scanner sc = new Scanner(System.in);
public static void main(String []args)
{
final int ONE_GAL = 350;
@joeyv
joeyv / Weight.java
Last active December 24, 2015 14:29
A simple program to calculate your ideal weight based off of your height.
import java.util.Scanner;
public class Weight
{
static Scanner sc = new Scanner(System.in);
public static void main(String []args)
{
double feet = 0.0, inch = 0.0, height = 0.0, girl = 0.0, man = 0.0;
double gper = 0.0, mper = 0.0;
@joeyv
joeyv / BirthdayGame.java
Last active December 25, 2015 00:29
Simple program to make your friends think your smart.
import java.util.Scanner;
public class Birthday
{
public static void main (String[] args)
{
double number;
double birthday;
Scanner scan = new Scanner(System.in);
@joeyv
joeyv / Pizza.java
Last active December 25, 2015 00:29
A simple program to pizza
import java.util.Scanner;
public class Pizza
{
public static void main (String[] args)
{
double size;
double cost;
Scanner scan = new Scanner(System.in);
@joeyv
joeyv / Change.java
Created October 11, 2013 17:34
Simple program to calculate change .
import java.util.Scanner;
public class Change
{
public static void main(String []args){
int cent, placeholder; //placeholder is to store the remainder number
int quarter, dime, nickel, penny;
@joeyv
joeyv / Dice.java
Created October 18, 2013 16:57
Roll two dice
import java.util.*;
public class Dice
{
public static void main(String []args)
{
int die1, die2;
// Random number generator
Random generator = new Random();
@joeyv
joeyv / Lottery.java
Created October 18, 2013 16:58
Lottery number generator
import java.util.*;
public class Lottery
{
public static void main(String []args)
{
// 6 Lottery numbers
int num1, num2, num3, num4, num5, num6;
// Random number generator
@joeyv
joeyv / PhoneNum.java
Last active September 21, 2023 13:41
Generates a random phone number
import java.util.*;
public class Phone
{
public static void main(String[] args)
{
int num1, num2, num3; //3 numbers in area code
int set2, set3; //sequence 2 and 3 of the phone number
Random generator = new Random();
@joeyv
joeyv / Stringmynips.java
Created October 21, 2013 17:34
idk lol
import java.util.Scanner;
public class StringManips
{
public static void main (String[] args)
{
String phrase = new String ("This is a String test.");
int phraseLength; // number of characters in the phrase String
int middleIndex; // index of the middle character in the String
String firstHalf; // first half of the phrase String
@joeyv
joeyv / Cubes.java
Created October 21, 2013 17:34
Cubes two inputs and adds them
import java.util.Scanner;
public class Cubes
{
public static void main(String[] args)
{
// Declare variables
double cube1, cube2;
double sum;