Strings Problem Set 1

Part I - Raptor Programs

String.1 Hello Name

Given a String name, e.g. "Bob", return a greeting of the form "Hello Bob!".

Test Case
Name Input
Program Output
1 Bob Hello Bob
2 Alice Hello Alice
3 X Hello X

Solutions:

python

raptor

String.2 Make Abba

Given two Strings, A and B, return a new String of the form ABBA. So for example, with the Strings "Hi" and "Bye", return "HiByeByeHi"

Test Case
A
B
Program Output
1 Hi Bye HiByeByeHi
2 Yo Alice YoAliceAliceYo
3 X Y XYYX

Solutions:

python

raptor

String.3 Make Tags

Given an HTML tag name, e.g. "b", and a word such as "Yay", create a String with HTML tags surrounding the word, such as "<b>Yay</b>".

Test Case
Tag
Name
Program Output
1 b Yay <b>Yay</b>
2 cite Yay <cite>Yay</cite>
3 i Hello <i>Hello</i>

Solutions:

python

raptor