EasterSunday.java - Name Hancheng Dai Instructor Alberto...

Info icon This preview shows pages 1–2. Sign up to view the full content.

// Name: Hancheng Dai // Instructor: Alberto Castro-Hernandez // CSE 174, Section F // Date: 9/16/2017 // Filename: FirstProgram.java // Description: Practice with writing, saving // and compiling code import java.util.Scanner; public class EasterSunday{ public static void main(String args[]){ Scanner keyBorder = new Scanner(System.in); System.out.print("Input the year : "); int yearOR = keyBorder.nextInt(); int a = yearOR%19; int b = yearOR/100; int c = yearOR%100; int d = b/4; int e = b%4; int g = (8*b+13)/25; int h = (19*a+b-d-g+15)%30; int j = c/4; int k = c%4; int m = (a+11*h)/319; int r = (2*e+2*j-k-h+m+32)%7; int n = (h-m+r+90)/25; int p = (h-m+r+n+19)%32; // entering the variables System.out.printf("a=%d\t\t\th=%d\t\t\tn=%d\n",a,h,n); System.out.printf("b=%d,c=%d\t\tj=%d,k=%d\t\t\tp=%d\n",b,c,j,k,p); System.out.printf("d=%d,e=%d\t\t\tm=%d\n",d,e,m); System.out.printf("g=%d\t\t\tr=%d\n",g,r); switch(n){ // using switch to get the string
Image of page 1

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

Image of page 2
This is the end of the preview. Sign up to access the rest of the document.
  • Fall '12
  • MichaelStahr

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern