Skip to content

Instantly share code, notes, and snippets.

@joeyv
joeyv / TaxCal.java
Last active December 28, 2015 16:49
import java.util.*;
import java.text.*;
public class TaxCalculator{
public static void main(String[]args){
int play, income;
double tax;
@joeyv
joeyv / Beer.java
Created November 13, 2013 18:11
Stupid game, don't play
import java.util.Scanner;
public class Beer{
public static void main(String []args){
int beer;
int num;
Scanner scan = new Scanner(System.in);
@joeyv
joeyv / OddNum.java
Created November 13, 2013 17:52
Tells how many zeros,odd, & even numbers there is in a user inputted number.
import java.util.Scanner;
public class OddNum{
public static void main(String []args){
int num;
int odd = 0, even = 0, zero = 0;
Scanner scan = new Scanner(System.in);
@joeyv
joeyv / HiLow.java
Last active December 28, 2015 01:09
Guessing game.
import java.util.*;
public class HiLow{
public static void main(String []args){
int num, play, guess, i = 1;
Scanner scan = new Scanner(System.in);
Random generator = new Random();
System.out.println("[1] Play\n[2] Quit");
@joeyv
joeyv / LeapUpdate.java
Last active December 27, 2015 09:49
Determines if any year past 1581 is a leap year or not.
import java.util.Scanner;
public class Leap{
public static void main(String []args){
int year,play;
System.out.println("[1] Enter year\n[2] Quit");
Scanner scan = new Scanner(System.in);
@joeyv
joeyv / Sticks.java
Created November 1, 2013 17:36
Sticks game not done lol
import java.util.*;
public class Sticks{
public static void main(String []args){
int sticks, maxStick = 0;
int userStick = 0, compStick = 0;
Scanner scan = new Scanner(System.in);
Random generator = new Random();
@joeyv
joeyv / Lucky7.java
Last active December 27, 2015 00:19
import java.util.*;
public class Lucky{
public static void main(String []args){
int money, userMoney; //userMoney is the amount user started with. Money is the total after the rolls
int die1, die2, sum;
int i = 1, roll = 0; // i is the counter, roll will hold the value of the counter when needed
Scanner scan = new Scanner(System.in);
@joeyv
joeyv / Prime.java
Last active December 26, 2015 19:29
IM STUCK
import java.util.Scanner;
public class Prime{
public static void main(String []args){
int total = 0;
int num,num2, i;
Scanner scan = new Scanner(System.in);
num = scan.nextInt();
@joeyv
joeyv / Factorial.java
Last active December 26, 2015 13:29
Calculates factorial of a number
import java.util.Scanner;
public class Factorial {
public static void main(String[] args) {
int total = 1;
int i, num;
Scanner scan = new Scanner(System.in);
num = scan.nextInt();
@joeyv
joeyv / Root.java
Last active December 26, 2015 11:39
Displays the square roots of 25 and every number 5 less than it until you reach 0. Using a while loop and for loop
public class Root {
public static void main(String[] args)
{
int base = 25;
while(base > 0){
System.out.println("Square root of " + base + "\t= " + Math.sqrt(base));
base -= 5;