Lan Clint Offemaria: Final Project
Lan Clint Offemaria: Final Project
Course & Year: BSIT 1-C Subject & Time: Computer Programming 2:30-4:00
FINAL PROJECT
Task 1:Create a program that will accept a number and convert the accepted
number to a roman number. Range of value 1-3999. If the value is not in the range
display "OUT OF RANGE" otherwise if the value is within the range display the
converted value in ROMAN NUMBERS.
#include <iostream>
#include <string>
using namespace std;
if (num >= 9) {
roman += "IX";
num -= 9;
} else if (num >= 5) {
roman += "V";
num -= 5;
} else if (num >= 4) {
roman += "IV";
num -= 4;
}
roman += string(num, 'I');
return roman;
}
int main() {
int num;
cout << "Enter a number : ";
cin >> num;
} else {
cout << num << " in roman is " << intToRoman(num) << endl;
}
return 0;
}
Task 2: Create a program that will accept a number and convert the accepted
number to a word. The range to be accepted is from 1 to 999999999.