Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Create a Simple Java program following the below instructions: A)Store your name (first and last together separated by one space ie. Mary Flower) in a

Create a Simple Java program following the below instructions:

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

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

C) 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)

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

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Pro SQL Server Administration

Authors: Peter Carter

1st Edition

1484207106, 9781484207109

More Books

Students also viewed these Databases questions

Question

How do Dimensional Database Models differ from Relational Models?

Answered: 1 week ago

Question

What type of processing do Relational Databases support?

Answered: 1 week ago

Question

Describe several aggregation operators.

Answered: 1 week ago