Program L3a Solution

$35.00 $29.00

Complete Programming Activity 1 – section 3.5. Download the code and put it in one project: SimpleDate.java SimpleDateClient.java See the attached file SampleRun.txt that contains a sample run of the finished program. Complete SimpleDateClient.java (SimpleDate.java is already complete). After completing the program provide answers (in a separate text file) to the Discussion Questions 1 and…

5/5 – (2 votes)

You’ll get a: zip file solution

 

Categorys:
Tags:

Description

5/5 – (2 votes)
  1. Complete Programming Activity 1 – section 3.5. Download the code and put it in one project: SimpleDate.java SimpleDateClient.java

    1. See the attached file SampleRun.txt that contains a sample run of the finished program.

    1. Complete SimpleDateClient.java (SimpleDate.java is already complete).

      1. After completing the program provide answers (in a separate text file) to the Discussion Questions 1 and 2 below the Programming Activity.

  1. In a different .java file (for example FunWithNames.java) convert the following pseudocode to Java code. Please remember to make your solution generic (call length method to get the number of characters in the String; call indexOf method to compute the index of a character) and the output “user friendly”. Example 3.6 may be helpful.

        1. Store your name (first and last together separated by one space ie. “Mary Flower”) in a String object referenced by the reference variable myFullName.

        1. Display myFullName in all upper case, display myFullName in all lower case, and next display the original myFullName.

          1. Display the number of characters in the myFullName object (ie. My name is Mary Flower and it is 11 characters long)

d. Extract the first name from the myFullName object and store it in the myFirstName String object (utilize indexOf method to compute index of space and use this information in the call to substring)

e. Extract the last name from the myFullName object and store it in the myLastName String object (use a similar technique as above)

f. Display myLastName followed by comma followed by myFirstName (ie. My inverted name is Flower,Mary)

g. Store your friend’s name (first, middle, and last together separated by one space ie “John Henry Smith”) in a String object referenced by the reference variable friendsFullName.

h. Display number of characters in the friendsFullName object (ie. My friend’s name is John Henry Smith and it is 16 characters long)

i. Extract the first name initial from the friendsFullName object and store it in the friendsFirstNameInitial char

j. Extract the last name initial from the friendsFullName object and store it in the friendsLastNameInitial char (utilize lastIndexOf method to get the index of the last space)

https://cilearn.csuci.edu/courses/5532/assignments/61965 1/2

12/14/2020 L3a

k. Display a message showing yours and your friend’s initials (ie. MF and JS are friends)

Please remember to zip all .java files together and submit for grading:

your project must compile; if the project does not compile an F will be awarded each file must contain your name; otherwise 1 point will be deducted from your score

the submitted source code must be formatted; otherwise 1 point will be deducted from your score

https://cilearn.csuci.edu/courses/5532/assignments/61965 2/2

Program L3a Solution
$35.00 $29.00