Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Random;
- public class Lesson3 {
- public static void main(String[] args) {
- Random randy = new Random();
- int first = randy.nextInt(10);
- int second = randy.nextInt(10);
- int result = addInts(first, second);
- if(result < 2) {
- System.out.println("Heads");
- }
- else {
- System.out.println("Tails");
- }
- }
- public static int addInts(int one, int two) {
- int result = 2;
- if(one > two) {
- result = 1;
- }
- else {
- result = 3;
- }
- return result;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement