You are on page 1of 2

FACULTY OF COMPUTER SCIENCE AND ENGINEERING

Time: 3 hrs CS102L Intensive Programming Lab Marks: 10

Section B Lab No: 03 Dated: 05/02/2020

Lab activity 1 :
Write a C++ function that should capitalizes the first letter in every word. Assume the first
letter is any letter at the beginning or preceded by a blank. All other letters should be turned
into lowercase. You can use the library toupper and tolower functions. Assume the prototype
is

void capitalizeWords(char a[]);


Hint:
Toupper(a) = A
Tolower(A) = a
You should treat string as an array or use .at(i) to access elements of string
getline(cin, sentence); // use this to get string from user in runtime

Example:
String: this is third lab of 102l
Resultant string: This Is Third Lab Of 102L

Lab activity 2 :

Write a C++ program that gets a Roman number in string format from user and converts it
into decimal number. You should write a separate function which converts from Roman
numbers to decimals.

Hint: The roman numbers are written according to: M = 1000, D = 500, C =100, L=50,
X=10, V=5, I=1.

Examples:

87 = LXXXVII

221 = CCXIX

1356 = MCCCLIV

2673 = MMDCLXXIII

You might also like