Add to Favorites    Make Home Page 297 Online  

 Language Categories  
 Our Services  

Home » Java Home » Algorithms Home » Calendar Generator

A D V E R T I S E M E N T

Search Projects & Source Codes:

Title Calendar Generator
Author Vipul Agrawal (CooLByteS)
Author Email vipul [at] coolbytes.info
Description It will generate calendar of any month of the years starting from 1000 A.D to Infinity
Category Java » Algorithms
Hits 17958
Code Select and Copy the Code
Code : // Made by Vipul Agrawal (CooLByteS) Visit us at www.coolbytes.tk import java.io.*; class cal1 { public static void main(String hj[]) throws Exception { welcome(); code(); } static void welcome() throws Exception { DataInputStream in = new DataInputStream(System.in); for(int y=0;y<24;y++) { System.out.println(); } String st1=new String(" ~~~~  | |~~~~ | | |~~~  |~~~ "); String st2=new String("    | | |  | |    |  "); String st3=new String("  --- | |=== |  | |  --- |=== "); String st4=new String("    | | |  | |    |  "); String st5=new String(" ____   |____ |____ | | |___   | "); char s1[]=new char[30]; char s2[]=new char[30]; char s3[]=new char[30]; char s4[]=new char[30]; char s5[]=new char[30]; s1=st1.toCharArray(); s2=st2.toCharArray(); s3=st3.toCharArray(); s4=st4.toCharArray(); s5=st5.toCharArray(); int len=st1.length(); for(int op1=0;op1<len;op1++) { Thread.sleep(5); System.out.print(s1[op1]); } System.out.println(); for(int op2=0;op2<len;op2++) { Thread.sleep(5); System.out.print(s2[op2]); } System.out.println(); for(int op3=0;op3<len;op3++) { Thread.sleep(5); System.out.print(s3[op3]); } System.out.println(); for(int op4=0;op4<len;op4++) { Thread.sleep(5); System.out.print(s4[op4]); } System.out.println(); for(int op5=0;op5<len;op5++) { Thread.sleep(5); System.out.print(s5[op5]); } int u=0; for(u=0;u<3;u++) { System.out.println(); } System.out.println(" LIMIT = 1000 A.D - INFINITY"); for(u=0;u<10;u++) { System.out.println(); } System.out.print("SPONSERED BY : "); String name=new String("Vipul Agrawal"); char n1[]=new char[25]; int l=name.length(); n1=name.toCharArray(); for(int nm=0;nm<l;nm++) { Thread.sleep(80); System.out.print(n1[nm]); } in.readLine(); for(int p=0;p<24;p++) { System.out.println(); } } static void code() throws Exception { DataInputStream in = new DataInputStream(System.in); String str; do{ int ch; int i,t=0,j=0,b=0,a=0; int y1=0,m1=0; System.out.println(); do{ System.out.println("Enter the month"); try{ m1=Integer.parseInt(in.readLine()); }catch(NumberFormatException tt) { System.out.println("Enter Integer Only"); System.out.println(); } if(m1<1 || m1>12) { System.out.println("Invalid Input"); System.out.println(); } }while(m1<1 || m1>12); for(i=0;i<24;i++) System.out.println(); do{ System.out.println("Enter the Year from 1000 onwards"); try{ y1=Integer.parseInt(in.readLine()); } catch(NumberFormatException tt) { System.out.println("Enter Integer Only"); System.out.println(); } if(y1<1000) { System.out.println("Invalid Input"); } }while(y1<1000); int d=2; int m=1; int y=1000; while(true) { if(m1<=m && y1<=y) { for(i=0;i<24;i++) System.out.println(); for(i=0;i<33;i++) System.out.print(" "); System.out.println("CALENDAR "+y); System.out.println(); for(i=0;i<33;i++) System.out.print(" "); if(m==1) System.out.println(" JANUARY"); if(m==2) System.out.println(" FEBRUARY"); if(m==3) System.out.println(" MARCH"); if(m==4) System.out.println(" APRIL"); if(m==5) System.out.println(" MAY"); if(m==6) System.out.println(" JUNE"); if(m==7) System.out.println(" JULY"); if(m==8) System.out.println(" AUGUST"); if(m==9) System.out.println(" SEPTEMBER"); if(m==10) System.out.println(" OCTOBER"); if(m==11) System.out.println(" NOVEMBER"); if(m==12) System.out.println(" DECEMBER"); System.out.println(); for(i=0;i<7;i++) System.out.print(" "); System.out.print("MON"); for(i=0;i<7;i++) System.out.print(" "); System.out.print("TUE"); for(i=0;i<7;i++) System.out.print(" "); System.out.print("WED"); for(i=0;i<7;i++) System.out.print(" "); System.out.print("THU"); for(i=0;i<7;i++) System.out.print(" "); System.out.print("FRI"); for(i=0;i<7;i++) System.out.print(" "); System.out.print("SAT"); for(i=0;i<7;i++) System.out.print(" "); System.out.print("SUN"); System.out.println(); System.out.println(); System.out.println(); } int w,mn; if(y1==y && m1==m) { for(i=0;i<t;i++) { System.out.print(" "); } for(;d>1;d--) { for(j=0;j<10;j++) { System.out.print(" "); t++; } } } else { for(i=0;i<t;i++) { } for(;d>1;d--) { for(j=0;j<10;j++) { t++; } } } if(m==1 || m==3 || m==5 || m==7 || m==8 || m==10 || m==12) { for(i=1;i<=31;i++) { if(y1==y && m1==m) { for(j=0;j<8;j++) { System.out.print(" "); t++; } if(i>=10) System.out.print(i); else System.out.print(" "+i); t+=2; if(t>=70) { System.out.println(); System.out.println(); t=0; } } else { for(j=0;j<8;j++) { t++; } if(i>=10) { } else { } t+=2; if(t>=70) { t=0; } } } } if(m==4 || m==6 || m==9 || m==11) { for(i=1;i<=30;i++) { if(y1==y && m1==m) { for(j=0;j<8;j++) { System.out.print(" "); t++; } if(i>=10) System.out.print(i); else System.out.print(" "+i); t+=2; if(t>=70) { System.out.println(); System.out.println(); t=0; } } else { for(j=0;j<8;j++) { t++; } if(i>=10) { } else { } t+=2; if(t>=70) { t=0; } } } } if(m==2) { if(y%4!=0) { for(i=1;i<=28;i++) { if(y1==y && m1==m) { for(j=0;j<8;j++) { System.out.print(" "); t++; } if(i>=10) System.out.print(i); else System.out.print(" "+i); t+=2; if(t>=70) { System.out.println(); System.out.println(); t=0; } } else { for(j=0;j<8;j++) { t++; } if(i>=10) { } else { } t+=2; if(t>=70) { t=0; } } } } else { for(i=1;i<=29;i++) { if(y1==y && m1==m) { for(j=0;j<8;j++) { System.out.print(" "); t++; } if(i>=10) System.out.print(i); else System.out.print(" "+i); t+=2; if(t>=70) { System.out.println(); System.out.println(); t=0; } } else { for(j=0;j<8;j++) { t++; } if(i>=10) { } else { } t+=2; if(t>=70) { t=0; } } } } } if(y1==y && m1==m) { for(j=0;j<4;j++) { System.out.println(); } } if(m1<=m && y1<=y) { break; } if(m==12) { y++; m=1; } else { m++; } } while(true){ System.out.println("Want see another calendar (y/n)?"); str=in.readLine(); if(str.equals("Y") || str.equals("y") || str.equals("N") || str.equals("n")) { break; } else { System.out.println("Invalid Input"); } } }while(str.equals("y") || str.equals("Y")); } }

Related Source Codes

Script Name Author
Sending mail Using JavaMail to Yahoo and Gmail accounts sai prasad
Simple Program in Java to Implement Multithreading Satish.K
Simple Calculator in Java Using Remote Method Invocation Satish.K
Guest Book Application Using Servlets Satish.K
String Manipulation Using Stringification Satish.K
String Manipulation Using Stringification Satish.K
Moving Ball Application Using Java Beans Satish.K
Rapid Roll game subrahmanyeswararao
student mgm arpan
Sourav Datta
Download Manager Sagar
Address Book in Java Rahul Chouhan
address book using java database connectivity(jdbc-msaccess) shekhar bansal
sun Steganography B.Rajavel
Connecting Java with MS-Access - Inserting data in Aseem

A D V E R T I S E M E N T




Google Groups Subscribe to SourceCodesWorld - Techies Talk
Email:


Free eBook - Interview Questions: Get over 1,000 Interview Questions in an eBook for free when you join JobsAssist. Just click on the button below to join JobsAssist and you will immediately receive the Free eBook with thousands of Interview Questions in an ebook when you join.

New! Click here to Add your Code!


ASP Home | C Home | C++ Home | COBOL Home | Java Home | Pascal Home
Source Codes Home Page

 Advertisements  

Google Search

Google

Source Codes World.com is a part of Vyom Network.

Vyom Network : Web Hosting | Dedicated Server | Free SMS, GRE, GMAT, MBA | Online Exams | Freshers Jobs | Software Downloads | Interview Questions | Jobs, Discussions | Placement Papers | Free eBooks | Free eBooks | Free Business Info | Interview Questions | Free Tutorials | Arabic, French, German | IAS Preparation | Jokes, Songs, Fun | Free Classifieds | Free Recipes | Free Downloads | Bangalore Info | Tech Solutions | Project Outsourcing, Web Hosting | GATE Preparation | MBA Preparation | SAP Info | Software Testing | Google Logo Maker | Freshers Jobs

Sitemap | Privacy Policy | Terms and Conditions
Copyright ©2003-2014 SourceCodesWorld.com, All Rights Reserved.
Page URL: http://www.sourcecodesworld.com/source/show.asp?ScriptID=994


Download Yahoo Messenger | Placement Papers | Free SMS | C Interview Questions | C++ Interview Questions | Quick2Host Review