00:01
First we create a java file.
00:04
Let's call it day of the week .java.
00:13
It automatically prompts a public class day of the week.
00:19
If your id doesn't automatically give you this, you have to manually enter this.
00:26
And then inside this we create our main method.
00:31
So main method, it is a public static void main and parentheses string bracket arcs.
00:44
And inside this we are going to write our code.
00:51
The first thing this program does is to print, enter to day state.
00:58
So system dot out, print.
01:08
Enter today's day.
01:15
Here i use print instead of print l and because we want the user enter value to appear right next to here, not the next line.
01:34
And then we want to retrieve the user input.
01:41
So we need to create a scanner object to do this so here we write scanner it automatically imports java utile scanner so scanner my scanner equal new create a new scanner so scanner and here inside this is a system so i'll use this my scanner object to retrieve user input so here i'm going to retrieve the user input so the user is going to enter an integer the today's day so i create a variable called today which is an integer equal my scanner bar next, int, so that it retrieves integer.
03:15
And then after this integer is entered, we still need to ask the user to enter the number of days elapsed since today.
03:26
So system dot out, print.
03:35
And here, enter the number of days, elapsed.
03:44
Elapsed things today.
03:50
So we create a new integer variable called day elapsed and then my scanner.
04:10
Next ink.
04:23
Finally we are going to print out system.
04:28
I'll start print.
04:38
We are going to print.
04:45
This time i use print l -print because i want to end the line after it is printed.
04:56
So we are going to print on the screen.
04:59
Today is and then plus the string.
05:07
Here we are going to put the today's day...