I can\'t do this. Please help; write pseudocode of this problem Write a program
ID: 3592732 • Letter: I
Question
I can't do this.
Please help; write pseudocode of this problem
Write a program that accepts the firstname and the lastname of the user, and display the first half of the lastname, first half of the firstname, second half of the lastname and second half of the firstname.
[Test your solution using this samples]
a. Firstname Input: Juan
Lastname Input: DelaCruz
Output: DelaJuCruzan
b. Firstname Input: Pedro
Lastname Input: Penduko
Output: PendPedukoro
c. Firstname Input: Johann
Lastname Input: Logan
Output: LogJohanann
d. Firstname Input: Mari
Lastname Input: Santamaria
Output: SantaMamariari
[Hints]
o To determine the first half of the name, you can use name[0, lengthOfName/2]
o To determine the second half of the name, you can use name[lengthOfName/2, lengthOfName]
o To determine the length of the name, you can use lengthOfName = GetLength(name)
Explanation / Answer
BEGIN
fname = ask user to enter first name
lname = ask user to enter last name
// compute first half of first name
f_half_first = fname[0, lengthOf(fname)/2]
// compute last half of first name
l_half_first = fname[lengthOf(fname)/2, lengthOf(fname)]
// compute first half of last name
f_half_last = fname[0, lengthOf(lname)/2]
// compute last half of last name
l_half_last = fname[lengthOf(lname)/2, lengthOf(lname)]
output = f_half_last + f_half_first + l_half_last + l_half_first
print("Output : ",output)
END
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.