SuperTutor

(15)

$15/per page/Negotiable

About SuperTutor

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Accounting,Business & Finance See all
Accounting,Business & Finance,Economics,Engineering,HR Management,Math Hide all
Teaching Since: Apr 2017
Last Sign in: 233 Weeks Ago, 5 Days Ago
Questions Answered: 12843
Tutorials Posted: 12834

Education

  • MBA, Ph.D in Management
    Harvard university
    Feb-1997 - Aug-2003

Experience

  • Professor
    Strayer University
    Jan-2007 - Present

Category > Programming Posted 09 Jun 2017 My Price 12.00

C++ program

Question:Write a C++ program that accepts a year written as a four-digit Arabic (ordinary) numeral and outputs the year written in Roman numerals.

Important:

Roman numerals are V for 5, X for 10, L for 50, C for 100, D for 500, and M for 1,000.

Recall that some numbers are formed by using a kind of subtraction of one Roman "digit"; for example, IV is 4 produced as V minus I, XL is 40, CM is 900, and so on.

A few sample years: MCM is 1900, MCML is 1950, MCMLX is 1960, MCMXL is 1940, MCMLXXXIX is 1989.

(Hints: Use division and mod.)

 

Assume the year is between 1000 and 3000. Prompt the user again if the user types less than 1000 or bigger than 3000.

Your program should include a loop that lets the user repeat this calculation until the user says she or he is done.

 

Define the following functions (value returning functions, Cally-by-Reference):

validateUserInput(): validates the user's input (must be between 1000 and 3000 and integers only).

returnRomanThousandsPlace(): returns roman numerals for the thousand place.

returnRomanHundredsPlace(): returns roman numerals for the hundreds place.

returnRomanTensPlace(): returns roman numerals for the tens place.

returnRomanOnesPlace(): returns roman numerals for the ones place.

 

 

**************************************************************************************

OUTPUTS:

**************************************************************************************

This program will accept a year written in four digit ordinary numeral and will

convert it into roman numerals.

Enter a year between 1000 and 3000:

5000

 

The year entered is invalid. Enter a valid year between 1000 to 3000:

1952

Your number in roman numerals is: MCMLII

 

Do you want to repeat the program again? y or n

y

Answers

(15)
Status NEW Posted 09 Jun 2017 07:06 AM My Price 12.00

-----------

Attachments

file 1496992334-Solutions file.docx preview (51 words )
S-----------olu-----------tio-----------ns -----------fil-----------e -----------Hel-----------lo -----------Sir-----------/Ma-----------dam----------- T-----------han-----------k y-----------ou -----------for----------- yo-----------ur -----------int-----------ere-----------st -----------and----------- bu-----------yin-----------g m-----------y p-----------ost-----------ed -----------sol-----------uti-----------on.----------- Pl-----------eas-----------e p-----------ing----------- me----------- on----------- ch-----------at -----------I a-----------m o-----------nli-----------ne -----------or -----------inb-----------ox -----------me -----------a m-----------ess-----------age----------- I -----------wil-----------l b-----------e q-----------uic-----------kly----------- on-----------lin-----------e a-----------nd -----------giv-----------e y-----------ou -----------exa-----------ct -----------fil-----------e a-----------nd -----------the----------- sa-----------me -----------fil-----------e i-----------s a-----------lso----------- se-----------nt -----------to -----------you-----------r e-----------mai-----------l t-----------hat----------- is----------- re-----------gis-----------ter-----------ed -----------onÂ----------- th-----------is -----------web-----------sit-----------e -----------Tha-----------nk -----------you----------- -----------
Not Rated(0)