do this for me plzz

do this for me plzz

View Answers

January 20, 2009 at 4:12 AM

Hi friend,

import java.util.*;
import java.text.*;

public class MonthView {

public final static String[] months = {
"January" , "February" , "March",
"April" , "May" , "June",
"July" , "August" , "September",
"October" , "November" , "December"
};

//days in each month
public final static int dom[] = {
31, 28, 31, // jan, feb, mar
30, 31, 30, // apr, may, jun
31, 31, 30, // jul, aug, sep
31, 30, 31 // oct, nov, dec
};

private void printMonth(int mm, int yy) {
int leadSpaces = 0;
System.out.println();
System.out.println(" " + months[mm] + " " + yy);
if (mm < 0 || mm > 11) {
throw new IllegalArgumentException(
"Month " + mm + " bad, must be 0-11");
}
GregorianCalendar cal = new GregorianCalendar(yy, mm, 1);
System.out.println("Su Mo Tu We Th Fr Sa"); //can change to "M T W T F S S"
leadSpaces = cal.get(Calendar.DAY_OF_WEEK)-1; //adjust for "M T W T F S S" if desired
int daysInMonth = dom[mm];
if (cal.isLeapYear(cal.get(Calendar.YEAR)) && mm == 1) daysInMonth++;
for (int i = 0; i < leadSpaces; i++) {
System.out.print(" ");
}
for (int i = 1; i <= daysInMonth; i++) {
if (i<=9) System.out.print(" ");
System.out.print(i);
if ((leadSpaces + i) % 7 == 0) {
System.out.println();
}
else {
System.out.print(" ");
}
}
System.out.println();
}

public static void main(String[] args) {
int month, year;
MonthView mv = new MonthView();
Calendar today = Calendar.getInstance();
mv.printMonth(today.get(Calendar.MONTH), today.get(Calendar.YEAR));
}
}

-----------------------------------------

Visit for more informaton:

http://www.roseindia.net/java/

Thanks.

Amardeep









Related Tutorials/Questions & Answers:
do this for me plzz - Java Interview Questions
do this for me plzz  Given the no of days and start day of a month print the calender of that month . Startday will be given as integer... to print in the same line i.e., without printing a newline. 2)You do
Help me plzz
Help me plzz  Hello Roseindia.... I need ur help urgently... I am... project not web project so kindly provide me a help.... It will be good for me if u provide me all required files like; strtus.xml web.xml 2 Jsp pages thnx
Advertisements
plzz tell me java code for that diamond
plzz tell me java code for that diamond   1 131 13531 1357531 13531 131 1
help me to do it in jsp
help me to do it in jsp  if we click on a topic it should direct to another page in separate window i need to create a part of the web page which... to insert and update the topics via admin page. pls help me to do
ModuleNotFoundError: No module named 'serve_me_do'
ModuleNotFoundError: No module named 'serve_me_do'  Hi, My Python... 'serve_me_do' How to remove the ModuleNotFoundError: No module named 'serve_me_do' error? Thanks   Hi, In your python environment
need someone do it for me plz..people
need someone do it for me plz..people  write an application that displays a menue of three items in a restaurant as follows: 1.Cheeseburger 4.99... selection he or she has already made, ignore the selection-that is,do not add a second
helllppp plzz
helllppp plzz   Create a method sum of even to find the sum of Multiples of number 5 from 10 to 50, and use it in a program . it's a c# program plz i need the solution
Why do the slashes change when the console gives me the error?
Why do the slashes change when the console gives me the error?   ..."; The console gives me back an error saying: java.io.FileNotFoundException: http...(Image.java:120) at java.lang.Thread.run(Thread.java:619) Why do the slashes change
i have a problem to do this question...pls help me..
i have a problem to do this question...pls help me..  Write a program that prompts the user to input an integer and the output the number with the digits reversed. For example if the input is 12345, the output should be 54321
inheritance....please help me friends...!!!... this is important project that i have to do it..
inheritance....please help me friends...!!!... this is important project that i have to do it..   Point ................. #x : int #y : int + Point() + Point(xCoordinate:int, YCoordinate:int) + getX() : int + getY() : int
ModuleNotFoundError: No module named 'plzz'
ModuleNotFoundError: No module named 'plzz'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'plzz' How to remove the ModuleNotFoundError: No module named 'plzz' error
do the combinations in java, pls help me its urhent - Development process
do the combinations in java, pls help me its urhent  import java.util.*; interface Expression { public void interpret(ArrayList exp); } class... one help me: action when condition1 and condition3 action when condition1
hi plzz reply
hi plzz reply  in our program of Java where we r using the concept of abstraction Plz reply i m trying to learn java ...   means in language of coding we r not using abstraction this will be used only for making ideas
could you suggest me that in which area i have to do a project?i want a complete guidence to complete my project.
could you suggest me that in which area i have to do a project?i want a complete guidence to complete my project.  could you suggest me that in which area i have to do a project?i want a complete guidence to complete my project
Run this code..plzz - Java Beginners
are defined in this example what you want to do please explain and send me full code
Reply me soon.........
Reply me soon.........  Any body plzz help.....how to get d checked details from previous page to current page and den insert into table
help me
help me  HI. Please help me for doing project. i want to send control from one jsp page to 2 jsp pages... is it possible? if possible how to do
sends me email
sends me email  How do I create a link that sends me email
cannot find symbol class array queue--plzz somebody help..
cannot find symbol class array queue--plzz somebody help..  import java.util.*; public class Test { public static void main(String[] args) { ArrayQueue<String> q = new ArrayQueue<String>(6); System.out.println
do the following
do the following  write a program to enter the string and do the following 1- count totle number of vowel 2- replace vowel 3- delete the charactor from given value 4- riverce the string 5- convert second word in upercase 6
Show me the code for that
Show me the code for that  JVM on my machine? And how do I know whether its working
The while and do
While and do-while      ... terminates. Have a look at do-while statement now. ADS_TO_REPLACE_3 Here is the syntax: do { statement(s) } while (expression); Lets
How do you do data mining projects?
do you do data mining projects? Try to provide me good examples or tutorials links so that I can learn the topic "How do you do data mining projects...How do you do data mining projects?  Hi, I am beginner in Data
how to do this?
how to do this?   Given any integer 2D array, design then implement a Java program that will add to each element in the array the corresponding column number and the corresponding row number. Then, it prints the array before
help me
help me  i have done as u directed but nothing happens gud to me..... . i am using netbeans is that matter at all help me and take me out from trouble where to store jfree api to use it for j2ee based project
help me
help me  hi sir pls tell me how to use ajax form validatin from very simple way with two ot three text field pls help me use ajax in php my email id is:- [email protected] pls sir give me some vasic information i know
help me
help me  please send me the java code to count the number of similar words in given string and replace that word with new one
please help me.
please help me.  I have a jsp page under that i add a list box under i get the countries through my database. so how can i do
help me please
help me please  how can i do dictionary with the use of array code in java, where i will type the word then the corresponding meaning for that word will appear...thanks
help me..
help me..   what are the component needed by grid computing, cloud computing and ubiquitous computing? discuss about the security of above computing. difference between that 3 computing
Help me
out from java output so how to do all dis
Remember Me
Remember Me  How to Create a PHP AutoLogin ('Remember Me') Feature using Cookies????   Hi Friend, Please visit the following links: http://www.roseindia.net/sql/mysql-example/Login-php.shtml http://www.roseindia.net
help me...
help me...  Write a program that inputs four words and them displays all possible permutations of the words. So, for example, if the words mad, dog, bites and man are entered, then the following are output : man bites mad dog
help me..
help me..  Write a program that inputs four words and them displays all possible permutations of the words. So, for example, if the words mad, dog, bites and man are entered, then the following are output : man bites mad dog mad
help me
help me  MY GLASSFISH SERVER NOT START PROPERLY help me warning shows DPL5404:Specification-Version for the optional package [ GNUJAXP ] in the jarfile [ C:\Program Files\Java\jdk1.7.0_02\jre\lib\ext\gnujaxp.jar
Do data analysts code?
the topic "Do data analysts code?". Also tell me which is the good...Do data analysts code?  Hi, I am beginner in Data Science and machine learning field. I am searching for the tutorials to learn: Do data analysts
Do data scientist code?
the topic "Do data scientist code?". Also tell me which is the good...Do data scientist code?  Hi, I am beginner in Data Science and machine learning field. I am searching for the tutorials to learn: Do data
help me
help me  Create a GUI application that allows a user to select a text file (using the JFileChooser). The program will then allow the user to do... program should list all the line number where the word is found. To do
help me...
help me...  there is the picture given - cat - dog - rabbit - mouse a. create a class name b. create its attributes (at least 3 attributes) : species, size, leg c. create its methods ( at least 3 methods) : walk, eat, sleep
help me
button, and nationality I'm using dropdown list. Please help me. your kindness
help me..
help me..  Design and write a class named Person and its two subclasses named Student and Employee. Make Lecturer and Admin subclasses of Employee. A person has a name, address, phone number and email address. A student has
help me
help me
please help me.
please help me.  I have three table in mysql,and i hava create a excel sheet and add this sheet.but my question is in every sheet i can display one one table result.how can i do
help me
the order, Fourth button is Find length of text. and there are panels. Please help me
php do while syntax
php do while syntax  How to create a do while loop in php. What is the syntax
php do while example
php do while example  Simple example of do while loop in PHP
php do while loop
php do while loop  Difference between do while loop and simple loop in PHP
please guide me - EJB
.Now i want to learn further .So please tell me whether should i learn EJB 3.0 or should learn Spring and Hibernate.I am confused what should i do next.Please advice me .At present i am jobless
ModuleNotFoundError: No module named 'do'
ModuleNotFoundError: No module named 'do'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'do' How to remove the ModuleNotFoundError: No module named 'do' error
need someone to do/help with code
need someone to do/help with code  i need someone to do a code for me. It is a restaurant menu that displays a list of 10 food items. A customer inputs what they want to eat and they receive back a total price for the order. Also

Ads