Ouput with valid input Enter your first middle and last name: Brandon John Brzuszkiewicz First: Brandon Middle: John Brzuszkiewicz Last: Output with invalid input Enter your first middle and last name: Brandon Brzuszkiewicz Enter your first middle and last name: Brandon Enter your first middle and last name: Brandon John Brzuszkiewcz First: Brandon Middle: John Brzuszkiewcz Last:

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter7: Characters, Strings, And The Stringbuilder
Section: Chapter Questions
Problem 3GZ
icon
Related questions
Question

Assignment Purpose:
The purpose of this lab assignment is to demonstrate knowledge of functions and
strings
This assignment is going to have you breaking up strings into substrings. The main logic will have us input a
person's first middle and last name separated by only a single space. You will be responsible for designing the
logic and writing the functions necessary for breaking up the name. Below you will find the function names and
the description of what they are to do.
1. Function findFirstOccurance - this function needs to accept 2 strings by parameter, the first is a
character to search for and the second a string to search for the character in. The function is to return
an integer value that represents the location of the first occurance of the character in the message. If it
does not find the character it should return a -1
2. Function findLastOccurance - this function sets up the same way as findFirstOccurance but will search
for the last occurance of the character in the message. It will reutrn the index of the character or a -1 if
the character does not exist.
3. You will need to make 3 other functions that all perform similar action. Functions getFirstName,
getLastName, and getMiddleName. Each funciton will accept a string as a parameter that will
represent the full name of a person. getFirstName will return a string of the first name, getLastName
will return the last name, and getMiddle will return the middle name
4. Main module will have us input a person's full name and verify that it contains a minimum of 2 spaces.
It will then display the person's first middle and last name appropriately. You will find the pseudocode
for the main method below.
For Submission
1. Pseduocode for findFirstOccurance that includes a looping activity
2. Flowchart for findLastOccurance that includes a looping activity
3. A python program that has all the supporting funcitons listed above and executes the mainline logic
pseudocoded below.
You will also find some sample output below for you to reference.
Module main():
Declarations
Str fullName
Str firstName
Str middleName
Str lastName
#input
Input fullname
#processing
While findFirstOccurance( “ “, fullName) == findLastOccurance(“ “, fullName):
Display error message
Input fullName
set firstName
set middleName
set lastName
#output
print firstName
print middleName
print lastName
return

Ouput with valid input
Enter your first middle and last name: Brandon John Brzuszkiewicz
First:
Brandon
Middle:
John
Brzuszkiewicz
Last:
Output with invalid input
Enter your first middle and last name: Brandon Brzuszkiewicz
Enter your first middle and last name: Brandon
Enter your first middle and last name: Brandon John Brzuszkiewcz
First:
Brandon
Middle:
John
Brzuszkiewcz
Last:
Transcribed Image Text:Ouput with valid input Enter your first middle and last name: Brandon John Brzuszkiewicz First: Brandon Middle: John Brzuszkiewicz Last: Output with invalid input Enter your first middle and last name: Brandon Brzuszkiewicz Enter your first middle and last name: Brandon Enter your first middle and last name: Brandon John Brzuszkiewcz First: Brandon Middle: John Brzuszkiewcz Last:
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 5 steps with 2 images

Blurred answer
Knowledge Booster
Variables
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,