Chapter Questions
Assume the following declaration appears in a program:Declare String name = "Joy"What would the following statement display?Display name [2]
Assume the following declaration appears in a program:Declare string str = "Tiger"Write a statement that changes the str variable's first character to "L".
Design an algorithm that determines whether the first character in the string variable str is a numeric digit, and if it is, deletes that character.
Design an algorithm that determines whether the first character in the string variable str is uppercase, and if it is, changes that character to $^{*} 0^{\prime \prime}$
Assume the following declaration appears in a program:Declare String str = "World"Write a statement that inserts the string "Hello $=$ at the beginning of the str variable. After the statement executes, the str variable should contain the string " Hello world".
Assume the following declaration appears in a program:Declare string city $=\cdots$ BostonWrite a statement that deletes the first three characters in the str variable.