program4 - /Item/Pasting this table in/your writeup/Your...

Info icon This preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
//Item Points Actual // Possible Points //Pasting this table in 1 //your writeup //Your name 1 //Description 1 //Function Comments 7 //(parameters, pre/post //conditions, descriptions) //Variable comments 2 //Use of functions 4 //Roman to English 10 //English to Roman 10 //Handles Multiple 1 //Expressions //3 test cases 3 / *********************************************************************** ********************************************************/ //Tom Nanke //CIS 150-001 //11-20-07 //Program 4 //This is a calculator program. It can add, subtract, or multiply roman numerals. #include <iostream> using namespace std; int romanToDecimal(int &number); char decimalToRoman(char &symbol); int main() { int j=0;
Image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
int k=0; int l=0; int m=0; int n=0; int x; int number; int number2; int number3; int number4; int number5; int number6; int number7; int number8; int number9; int number10; int number11; int number12; char symbol; while(number!='0') { cout<<"Enter a roman expression."<<endl; romanToDecimal(number); cout<<number<<endl; if(number>=1000) { symbol='M'; x=number/1000; while(j<x) { cout<<'M'; j++; } } number2=(x*1000); number3=number-number2; if(number3>=500) { symbol='D'; x=number3/500; while(k<x) { cout<<'D';
Image of page 2
k++; } } number4=(x*500); number5=number3-number4; if(number5>=100) { symbol='C';
Image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern