Skip to content

Instantly share code, notes, and snippets.

@AndresRodz
AndresRodz / CircleArea.java
Created February 13, 2014 00:43
Calculate and return the area of a circle, given the radius.
import java.util.Scanner;
public class CircleArea {
public static void main(String [] args) {
Scanner input = new Scanner(System.in);
double radius = input.nextDouble();
double area = Area(radius);
System.out.println(area);
import java.util.Scanner;
public class LargestArray {
public static void main(String [] args) {
Scanner input = new Scanner(System.in);
int variables = input.nextInt();
int[] a = new int[variables];
for (int i = 0; i < a.length; i++) {
import java.util.Scanner;
public class MultipleInt {
public static void main(String [] args) {
Scanner input = new Scanner(System.in);
int a = input.nextInt();
int b = input.nextInt();
boolean c = multipleNumber(a,b);
System.out.println(c);
import java.util.Scanner;
public class AreEqual {
public static void main(String [] args) {
int variable;
Scanner input = new Scanner(System.in);
int variables = input.nextInt();
int[] array1 = new int[variables];
int[] array2 = new int[variables];
import java.util.Scanner;
public class MergeArrays {
public static void main(String [] args) {
Scanner input = new Scanner(System.in);
int variables = input.nextInt();
int[] array1 = new int[variables];
int[] array2 = new int[variables];
import java.util.Scanner;
public class ReverseArray {
public static void main(String [] args) {
Scanner input = new Scanner(System.in);
int variables = input.nextInt();
int[] array1 = new int[variables];
for (int i = 0; i < array1.length; i++) {
@AndresRodz
AndresRodz / Fibonacci.java
Created January 20, 2014 23:51
Fibonacci Java Program
import java.util.Scanner;
public class Fibonacci {
public static void main (String [] args) {
long f = 0;
long n = 1;
Scanner input = new Scanner(System.in);
System.out.println("Please enter the index number you would like to print");
@AndresRodz
AndresRodz / FinancialManagement.java
Created December 2, 2013 04:43
Larry graduated this year and finally has a job. He's making a lot of money, but somehow never seems to have enough. Larry has decided that he needs to grab hold of his financial portfolio and solve his financing problems. The first step is to figure out what's been going on with his money. Larry has his bank account statements and wants to see …
import java.util.Scanner;
import java.io.*;
import java.text.DecimalFormat;
public class FinancialManagement {
public static void main(String [] args) {
Scanner input = new Scanner(System.in);
double[] money;
money = new double[12];
@AndresRodz
AndresRodz / TraversingGrid.java
Created December 2, 2013 04:40
Starting at the top left corner of an N x M grid and facing towards the right, you keep walking one square at a time in the direction you are facing. If you reach the boundary of the grid or if the next square you are about to visit has already been visited, you turn right. You stop when all the squares in the grid have been visited. What direct…
import java.io.*;
import java.util.Scanner;
public class TraversingGrid {
public static void main (String [] args) {
Scanner input = new Scanner(System.in);
int casos = input.nextInt();
@AndresRodz
AndresRodz / Sum.java
Created December 2, 2013 04:39
Your task is to find the sum of all integer numbers lying between 1 and N inclusive. Input specification The input consists of a single integer N that is not greater than 10^4 by it's absolute value. Output specification Write to the output a single integer number that is the sum of all integer numbers lying between 1 and N inclusive. Sample inp…
import java.io.*;
import java.util.Scanner;
public class Sum {
public static void main(String [] args) {
Scanner scan = new Scanner(System.in);
int n;
int temp=0;