How do i do this
Archiviert 3 years ago
S
sip
1. Write pseudocode for an algorithm which allows the user to enter their first name and surname. The algorithm will then output their name in the format “initial surname”.
e.g. Input 1: “Jim”, Input 2: “Daley”, Output: “J Daley”
The algorithm will also need to have the initial and first letter of the surname as capital letters. All other letters of the surname will need to be lowercase.
e.g. Input 1: “george”, Input 2: “garlAnd”, Output: “G Garland”
Assume the string in indexed from 0, so the first character in the string will be referred to as stringName[0].
Make use of concatenation and the following functions:
s.length finds the length of s
s.upper gives the uppercase of s
s.lower gives the lowercase of s
s.right(n) gives the right n characters of s
s.left(n) gives the left n characters of s
