View
 

Lab 5: Strings

Page history last edited by Yahoo Ken 7 months, 2 weeks ago

Name: __________________

Pre-lab Quiz

  1. Consider the following code:

          String firstName = “Edsger”, lastName = “Dijkstra”;

          String fullName = lastName + “, “ + firstName;

 

          int n = fullName.length();

 

                    What is the value of n?

 

  1. “Strings are immutable” means.

          [ ] They can not be changed
          [ ] They can not be converted to integers
          [ ] They can not be printed.

Lab Instructions

Getting Started

  1. Create a project called Password

  2. Import the files from R:\Ap Java\Projects\Lab5 Password

  3. Edit the file Password.java

Assignment

  1. Your program will read in a line of data from the user. You can assume the input is a person's first and last name

  2. Your program will print out the person's Middletown email address; the name is the person's last name followed by this or her first initial. The domain is middletownk12.org 

  3. You will also print out the person't recommended password, which is the first four letters of their last name, in all lower case, followed buy the first four letters of their first name, in all upper case. Any instance of a o will be replaced with a zero. In other words, the default password for "Robert Moses"  is "m0seR0BE"

Wrap-up

  1. Print our your source code

  2. Hand in your source code with your grade sheet.

 

Grading

 

Points

Extra

Correct

Incorrect

Quiz

2

 

 

 

Input

1

 

 

 

Print length

1

 

 

 

Cut word

3

 

 

 

Asterisks

2

 

 

 

Caps

1

 

 

 

 

 

 

 

 

Fails to compile

-1

 

 

 

Late

-1

 

 

 

Total

10

 

 

 

Comments

 

 

Comments (0)

You don't have permission to comment on this page.