1. ## Some little applications i made by myself.

My calculator :)
Java Code:
```mport java.util.Scanner;
public class Rekenmachine {
public static void main (String args[]){
Scanner input = new Scanner (System.in);
Scanner input2 = new Scanner (System.in);
double fnum;
double snum;
System.out.println ("Add, Substract, Divide, or Multiply?");
String math = input.nextLine();
switch (math){
System.out.println ("First number: ");
fnum = input.nextInt();
System.out.println("Second number: ");
snum = input.nextInt();
System.out.println(snum + fnum);
break;
case "substract":
System.out.println("First number: ");
fnum = input.nextDouble();
System.out.println("Second number: ");
snum = input.nextDouble();
System.out.println(fnum - snum);
break;
case "divide":
System.out.println("First number: ");
fnum = input.nextDouble();
System.out.println("Second number: ");
snum = input.nextDouble();
System.out.println(fnum / snum);
break;
case "multiply":
System.out.println("First number: ");
fnum = input.nextDouble();
System.out.println("Second number: ");
snum = input.nextDouble();
System.out.println(fnum * snum);

}
}
}```
my little program that generates random numbers and then you have to guess them, if you guess the right number it displays something. and if you guesses it wrong it displays something.
Java Code:
```import java.util.Scanner;
import java.util.Random;
public class RandomNumbers {
public static void main(String args[]){
Random rand = new Random();
Scanner mick = new Scanner (System.in);
int rand1 = rand.nextInt(10);
int rand2 = rand.nextInt(10);
int rand3 = rand.nextInt(10);

System.out.println("Guess the first number 1-10: ");
if(rand1 == mick.nextInt()){
System.out.println("\nCorrect!");
}else{
System.out.println("\nIncorrect! The right number was: "+rand1);
}
System.out.println("\n");
System.out.println("Guess the second number 1-10: ");
if(rand2 == mick.nextInt()){
System.out.println("\nCorrect!");
}else{
System.out.println("\nIncorrect! The right number was: "+rand2);
}
System.out.println("\n");
System.out.println("Guess the third number 1-10: ");
if(rand3 == mick.nextInt()){
System.out.println("\nCorrect!");
}else{
System.out.println("\nIncorrect! The right number was: "+rand3);
}

}

}```
my euro to dollar, and dollar to euro converter (i still need to let the course update by itself with connection things etc.)
Java Code:
```import java.util.Scanner;

class Eurodollar {
public static void main(String args []){
Scanner input = new Scanner (System.in);
System.out.println("press 1 for Euro > Dollar \t press 2 for Dollar > Euro");
int amount;
String eurodollar = input.nextLine();
switch(eurodollar){
case "1":
System.out.println("You chose for: Euro > Dollar ");
System.out.println("\n");
System.out.println("Enter the amount: ");
{
amount = input.nextInt();
System.out.println("Euro"+"\t"+"Dollar");
System.out.println(amount+ "\t" +(amount *  0.767636447));
}
break;
case "2":
System.out.println("You chose for: Dollar > Euro ");
System.out.println("\n");
System.out.println("Enter the amount: ");
amount = input.nextInt();
System.out.println("Dollar"+"\t"+"Euro");{
System.out.println(amount+ "\t" +(amount / 0.767636447));

}
}
}
}```

2. Senior Member
Join Date
Nov 2012
Posts
257
Rep Power
8

## Re: Some little applications i made by myself.

Nice start! maybe start looking at turning your current applications into GUI versions, having everything run by the console is far from ideal ;)

Look up Swing, action events, mouse events, Threads etc. and try and turn you calculator into a GUI calculator, it should be fairly simple to do :)

also switching Strings is case sensitive i think ( at least it is with chars) so if somebody entered "Add" or "ADD" it would technically cause your application to run incorrectly. You should look into error prevention a lot more although these are simple applications you should start to think about "bombing" and error checking.
Last edited by monkeyjr97; 05-05-2013 at 12:23 AM.

3. ## Re: Some little applications i made by myself.

Thanks, and also thanks for the information you gave me! :)

ill look into it