Question

Language: Java The date June 10 1960 is special because when it is written in the...

Language: Java

The date June 10 1960 is special because when it is written in the form: month times day it will equal to the year (last two digits only). For example, 6 (for June) times 10 (day 10) equals 60 (the last two digits of year 1960).

Write program to prompt user to enter month as an integer, day as an integer and a 2-digits integer for the year. No need to validate these input. Only test for being special or not later! Then determine if it is a special date or not. If values entered happens to be a “Special Date” then display all values and indicated that it is “SpecialDate”. Otherwise display “NOT a Special date”

Note: You will display value for month, day and year regardless if it is special or not.

0 0
Add a comment Improve this question Transcribed image text
Answer #1


import java.util.Scanner;

public class TestSpecialDate {
   public static void main(String[] args) {
       Scanner sc = new Scanner(System.in);
       //reading day,month,year
       System.out.print("Enter day: ");
       int day=sc.nextInt();
       System.out.print("Enter month: ");
       int month=sc.nextInt();
       System.out.print("Enter year: ");
       int year=sc.nextInt();
       //printing date
       System.out.println(day+"/"+month+"/"+year);
       //checking if it special date
       if(day*month == year)
           System.out.println("SpecialDate");
       else
           System.out.println("NOT a Special date");
   }
}

Note : Please comment below if you have concerns. I am here to help you

If you like my answer please rate and help me it is very Imp for me

Add a comment
Know the answer?
Add Answer to:
Language: Java The date June 10 1960 is special because when it is written in the...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • java programming Submit this part as separate text file named Lab4Questions. Activities: Magic Dates [8 pts]...

    java programming Submit this part as separate text file named Lab4Questions. Activities: Magic Dates [8 pts] The date June 10, 1960, is special because when you write it in the following format, the month times the day equals the year. 6/10/60 Write a program (Magic Dates.java) that asks the user for the month as a numeric, a day, and a two-digit year. The program should then determine whether the month times the day is equal to the year. If so,...

  • Create class Date with the following capabilities: a) Output the date in multiple formats, such as...

    Create class Date with the following capabilities: a) Output the date in multiple formats, such as MM/DD/YYYY June 14, 1992 DDD YYYY b) Use overloaded constructors to create Date objects initialized with dates of the formats in part (a). In the first case the constructor should receive three integer values. In the second case it should receive a String and two integer values. In the third case it should receive two integer values, the first of which represents the day...

  • Write a java application, Date, that reads an 8-digit integer value (indicating a date) from the...

    Write a java application, Date, that reads an 8-digit integer value (indicating a date) from the keyboard; the first two digits indicate the month, the second two digits represent the day and the last 4 digits represent the year. After calculating the month, the application will implement a switch statement to output the month. After displaying the date, the application will implement a nested if else statement to output the appropriate century. i.e Prev17th century, 18th century, 19th century, 20th...

  • Can someone please help me with this problem, I am new in this and I got no idea how to make it ?

    Must contain several methods to provide reading functions,performing calculations and posting the results.Main Main method for executing execution Method for reading data from the keyboard Method for performing calculations according to the problem request Method for posting resultsThe main method must contain at least:A menu for selecting the function (Reading data, Performing calculations, Posting ioutput, Exit the program) using the switch / case instruction.The menu must be included within a do / while cycle in order for the e functions...

  • Build a java program to validate a date in the future as entered by the user...

    Build a java program to validate a date in the future as entered by the user at the keyboard as three separate integer values: mm dd yyy Acceptable data criteria: 1. mm: month in range of 1-12 2. dd: day in range of 1-30 for April, June. September, & Nov. / 1-31 January, March, May, July, August, October, & December. Only accept 1-28 for February at this point. 3. yyy: current year (as long as the month and day have...

  • Programming language: JAVA Implement a superclass Appointment and subclasses OneTime, Daily, and Monthly. An appointment has...

    Programming language: JAVA Implement a superclass Appointment and subclasses OneTime, Daily, and Monthly. An appointment has a description (for example "see the dentist") and a date. Write a method OccursOn (int year, int month, int day) that checks whether the appointment occurs on that date. For example, for a monthly appointment, check whether the day of the month matches. Ask the user to enter a date to check (for example, 2006 10 5), and ask to user if they want...

  • JAVA programing Question 1 (Date Class):                                   &nbsp

    JAVA programing Question 1 (Date Class):                                                                                                     5 Points Create a class Date with the day, month and year fields (attributes). Provide constructors that: A constructor that takes three input arguments to initialize the day, month and year fields. Note 1: Make sure that the initialization values for the day, month and year fields are valid where the day must be between 1 and 31 inclusive, the month between 1 and 12 inclusive and the year a positive number. Note 2:...

  • Create a class called Date212 to represent a date. It will store the year, month and...

    Create a class called Date212 to represent a date. It will store the year, month and day as integers (not as a String in the form yyyymmdd (such as 20161001 for October 1, 2016), so you will need three private instance variables. Two constructors should be provided, one that takes three integer parameters, and one that takes a String. The constructor with the String parameter and should validate the parameter. As you are reading the dates you should check that...

  • I need this in Java, please! The ISO 8601 Standard date format for Information Interchange indicates...

    I need this in Java, please! The ISO 8601 Standard date format for Information Interchange indicates that a date be written as such: yyyy-MM-dd (eg. 2012-07-02, 1999-12-05, 1998 -01-27 ) where yyyy represents the four digit year MM represents a two digit numerical month dd represents a two digit numerical day Chinese date format is specified as: yyyy-M-d Macedonean date format is specified as: d.M.yyyy where yyyy represents the four digit year M represents a one or two digit numerical...

  • I need to create a Java class file and a client file that does the following:  Ask user to enter Today’s date in the fo...

    I need to create a Java class file and a client file that does the following:  Ask user to enter Today’s date in the form (month day year): 2 28 2018  Ask user to enter Birthday in the form (month day year): 11 30 1990  Output the following: The date they were born in the form (year/month/day). The day of the week they were born (Sunday – Saturday). The number of days between their birthday and today’s...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT