-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUnit4_disc1.java
More file actions
32 lines (26 loc) · 860 Bytes
/
Unit4_disc1.java
File metadata and controls
32 lines (26 loc) · 860 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/********************************************
- Sean Cochran 11APR2017
- attempts to authenticate user based on input
- if unable to auth, prgram provides guidance
*********************************************/
import java.util.Scanner;
public class Main
{
public static void main(String[] args)
{
Scanner keyboard = new Scanner(System.in);
System.out.println("Please enter your user name (first.last): ");
String userName = keyboard.nextLine();
char lastChar = mySentence.charAt(mySentence.length()-1);
char firstChar = mySentence.charAt(0);
if ((lastChar == '.') && (firstChar == 'H'))
{
System.out.println("Is correct");
}
else
{
System.out.println("Is NOT correct");
}
}
}
if ((lastChar == '.') && (firstChar == 'H'))