Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Project 2
- *
- * Z@in @rfi
- * October 22 2015
- */
- import java.util.*;
- public class Project2
- {
- public static void main(String[] args)
- {
- Scanner console = new Scanner(System.in);
- System.out.println("What is the GPA of Applicant 1?");
- double GPA1 = console.nextDouble();
- System.out.println("What is the ACT score of Applicant 1?");
- double ACT1 = console.nextDouble();
- System.out.println("What is the SAT score of Applicant 1?");
- double SAT1 = console.nextDouble();
- System.out.println("What is the GPA of Applicant 2?");
- double GPA2 = console.nextDouble();
- System.out.println("What is the ACT score of Applicant 2?");
- double ACT2 = console.nextDouble();
- System.out.println("What is the SAT score of Applicant 2?");
- double SAT2 = console.nextDouble();
- Acceptance(GPA1, ACT1, SAT1, GPA2, ACT2, SAT2);
- }
- public static void Acceptance(double gpa1, double act1, double sat1, double gpa2, double act2, double sat2)
- {
- int a = 0;
- int b = 0;
- if(gpa1 > gpa2)
- {
- a = 1;
- }
- else if(gpa2 < gpa1)
- {
- b = 1;
- }
- else
- {
- a = 0;
- b = 0;
- }
- if(act1 > act2)
- {
- a = a + 1;
- }
- else if(act1 < act2)
- {
- b = b + 1;
- }
- else
- {
- a = a + 0;
- b = b + 0;
- }
- if(sat1 > sat2)
- {
- a = a + 1;
- }
- else if(sat1 < sat2)
- {
- b = b + 1;
- }
- else
- {
- a = a + 0;
- b = b + 0;
- }
- if( a > b)
- {
- System.out.println("Applicant 1 is more qualified!");
- }
- else if( a < b)
- {
- System.out.println("Applicant 2 is more qualified!");
- }
- else
- {
- System.out.println("Applicant 1 and Applicant 2 are equally qualified!");
- }
- }
- }
- /**
- * Project 2
- *
- * Z@in @rfi
- * September 23
- */
- import java.util.*;
- public class Project4
- {
- public static void main(String[] args)
- {
- Scanner console = new Scanner(System.in);
- System.out.println("What is the month of your birthday in numbers?");
- int month1 = console.nextInt();
- System.out.println("What is the day of your birthday?");
- int day1 = console.nextInt();
- System.out.println("What is the month of the other person's birthday in numbers?");
- int month2 = console.nextInt();
- System.out.println("What is the day of person two's birthday?");
- int day2 = console.nextInt();
- Calculate(month1, day1, month2, day2);
- }
- public static void Calculate(int m1, int d1, int m2, int d2)
- {
- int absoday1 = 0;
- int absoday2 = 0;
- if( m1 == 1)
- {
- absoday1 = 0;
- }
- else if( m2 == 1)
- {
- absoday2 = 0;
- }
- else if( m1 == 2)
- {
- absoday1 = 31;
- }
- else if( m1 == 3)
- {
- absoday1 = 59;
- }
- else if( m1 == 4)
- {
- absoday1 = 90;
- }
- else if( m1 == 5)
- {
- absoday1 = 120;
- }
- else if( m1 == 6)
- {
- absoday1 = 151;
- }
- else if( m1 == 7)
- {
- absoday1 = 181;
- }
- else if( m1 == 8)
- {
- absoday1 = 212;
- }
- else if( m1 == 9)
- {
- absoday1 = 243;
- }
- else if( m1 == 10)
- {
- absoday1 = 273;
- }
- else if( m1 == 11)
- {
- absoday1 = 304;
- }
- else if(m1 == 12)
- {
- absoday1 = 334;
- }
- else if( m2 == 2)
- {
- absoday2 = 31;
- }
- else if( m2 == 3)
- {
- absoday2 = 59;
- }
- else if( m2 == 4)
- {
- absoday2 = 90;
- }
- else if( m2 == 5)
- {
- absoday2 = 120;
- }
- else if( m2 == 6)
- {
- absoday2 = 151;
- }
- else if( m2 == 7)
- {
- absoday2 = 181;
- }
- else if( m2 == 8)
- {
- absoday2 = 212;
- }
- else if( m2 == 9)
- {
- absoday2 = 243;
- }
- else if( m2 == 10)
- {
- absoday2 = 273;
- }
- else if( m2 == 11)
- {
- absoday2 = 304;
- }
- else if(m2 == 12)
- {
- absoday2 = 334;
- }
- else
- {
- absoday1 = 0;
- }
- if( m1 > m2)
- {
- System.out.println("Person 2's Birthday is sooner!");
- int diff = (absoday1 + d1) - (absoday2 + d2);
- System.out.println(diff + " days until Person 1's Birthday!");
- }
- else if( m1 < m2)
- {
- System.out.println("Person 1's Birthday is sooner!");
- int diff = (absoday2 + d2) - (absoday1 +d2);
- System.out.println(diff + " days until Person 2's Birthday!");
- }
- else if( m1 == m2 && d1 != d2)
- {
- if( d1 > d2)
- {
- System.out.println("Person 2's Birthday is sooner!");
- int diff = d1 - d2;
- System.out.println(diff +" days until Person 1's Birthday!");
- }
- else if( d1 < d2)
- {
- System.out.println("Person 1's Birthday is sooner!");
- int diff = d2 - d1;
- System.out.println(diff + " days until Person 2's Birthday!");
- }
- }
- else
- {
- System.out.println("Y'all have the same birthday!");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement