Examlex

Solved

Complete This Code in Main to Perform the Requested Operations

question 87

Essay

Complete this code in main to perform the requested operations for a date entered by the user in this format: month dd, yyyy.
public static void main( String [] args )
{
Scanner scan = new Scanner( System.in );
System.out.print( "Enter a date > " );
String date = scan.nextLine( );
Output the first letter in the month.
Output the date in all lowercase letters.
Output the year portion of the date-that is, the characters in the date that follow the comma. For example, if the date is February 24, 2016, you would output 2016. (Note: Your code should work for ANY date in that format.)


Definitions:

Hand Washing

The act of cleaning the hands with soap and water or hand sanitizer to prevent the spread of infection.

Lather

The frothy foam created by agitating soap with water, commonly used for cleaning or bathing.

Rings and Watches

Personal jewelry items worn on fingers and wrists that can pose safety hazards or interfere with medical procedures if not removed.

Hot Water

Water heated to a temperature suitable for bathing, washing, or cooking.

Related Questions