Resources » Articles/Knowledge Sharing » Computer & Technology

Computer Practical Question In Isc Examination Solved In Bluej Java


Posted Date: 17-Mar-2011  Last Updated:   Category: Computer & Technology    
Author: Member Level: Silver    Points: 10


Find out the valid date. This question came in class 12(ISC) examination -2011. See the solve program.



import java.util.*;
class days
{
public void abc()
{int p=0;
Scanner a=new Scanner(System.in);
System.out.println("Input:");
System.out.print("Month number ");
int MM=a.nextInt();
System.out.print("Day ");
int DD=a.nextInt();
System.out.print("Year ");
int YYYY=a.nextInt();
System.out.print("Output:");
System.out.print("Corresponding day of the year is : ");
if(YYYY%4==0)
{
p=29;
}
else
{
p=28;
}
switch(MM)
{
case 1:
{
System.out.println(DD);
}
break;
case 2:
{int sum=31+DD;
System.out.println(sum);
}
break;
case 3:
{
int sum=31+p+DD;
System.out.println(sum);
}
break;
case 4:
{
int sum=31+p+31+DD;
System.out.println(sum);
}
break;
case 5:
{
int sum=31+p+31+30+DD;
System.out.println(sum);
}
break;
case 6:
{
int sum=31+p+31+30+31+DD;
System.out.println(sum);
}
break;
case 7:
{
int sum=31+p+31+30+31+30+DD;
System.out.println(sum);
}
break;
case 8:
{
int sum=31+p+31+30+31+30+31+DD;
System.out.println(sum);
}
break;
case 9:
{
int sum=31+p+31+30+31+30+31+31+DD;
System.out.println(sum);
}
break;
case 10:
{
int sum=31+p+31+30+31+30+31+31+30+DD;
System.out.println(sum);
}
break;
case 11:
{
int sum=31+p+31+30+31+30+31+31+30+31+DD;
System.out.println(sum);
}
break;
case 12:
{
int sum=31+p+31+30+31+30+31+31+30+31+30+DD;
System.out.println(sum);
}
break;
default:
System.out.println("Invalid");
}
}
}


Did you like this resource? Share it with your friends and show your love!




Responses to "Computer Practical Question In Isc Examination Solved In Bluej Java"

No responses found. Be the first to respond...

Feedbacks      

Post Comment:




  • Do not include your name, "with regards" etc in the comment. Write detailed comment, relevant to the topic.
  • No HTML formatting and links to other web sites are allowed.
  • This is a strictly moderated site. Absolutely no spam allowed.
  • Name:   Sign In to fill automatically.
    Email: (Will not be published, but required to validate comment)



    Type the numbers and letters shown on the left.


    Submit Article     Return to Article Index

    Awards & Gifts
    Active Members
    TodayLast 7 Daysmore...

    ISC Technologies, Kochi - India. Copyright © All Rights Reserved.