Finish Lab10
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
/*
|
||||
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
|
||||
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
|
||||
*/
|
||||
package lab10_calebfontenot;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author caleb
|
||||
*/
|
||||
public class PasswordMaker1 {
|
||||
public static void main(String[] args) {
|
||||
String firstName = "Caleb";
|
||||
String middleName = "Christopher";
|
||||
String lastName = "Fontenot";
|
||||
int age = 20;
|
||||
//> extract initials
|
||||
String initials = firstName.substring(0,1) +
|
||||
middleName.substring(0,1) +
|
||||
lastName.substring(0,1);
|
||||
//> append age after changing the initials to lower case
|
||||
String password = initials.toLowerCase() + age;
|
||||
System.out.println("Your Password = " + password);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user