This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.*; | |
import java.text.*; | |
public class TaxCalculator{ | |
public static void main(String[]args){ | |
int play, income; | |
double tax; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Scanner; | |
public class Beer{ | |
public static void main(String []args){ | |
int beer; | |
int num; | |
Scanner scan = new Scanner(System.in); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
NewerOlder