[Show all top banners]
Back to: Computer/IT Refresh page to view new replies
 c++ assignment
[VIEWED 3326 TIMES]
SAVE! for ease of future access.
Posted on 04-26-11 10:42 PM     Reply [Subscribe]
Login in to Rate this Post:     3       ?     Liked by
 

 

 Purpose: To help develop logic and problem solving skills while continuing to work with header files and Object Oriented constructs, including: classes, constructors and overloading. 

Goal: To design and implement a Roman Numeral Number class. The class should be able to build Roman numerals for various values (int parameter to constructor and to a setas* function), and be able to produce values for roman numerals (string result).For this class you only need to consider decimal (base 10) integer numbers. 

Turn-in: 

 File name: assignments/assign5/assign5.cpp 

 Programming Style Requirements: 

o Comment block at the top-left that includes your Linux User ID, Name, Course, Assignment Title, and Date. 

o Comment block Explaining purpose of the program 

 Printed program listing, which includes sample output 

o 3 separate files: 

assign5.cpp (with sample output in comments), header and implementation file. 

o Hand-printed name in top right corner, stapled in top left corner. 

 

Reference Links: 

 A few sites to help you out: 

o http://mathforum.org/dr.math/faq/faq.roman.html 

o http://www.yourdictionary.com/crossword/romanums.html 

o http://home.hiwaay.net/~lkseitz/math/roman/numerals.shtml 

o http://home.hiwaay.net/~lkseitz/math/roman/ 

 

Program Details: 

Your class will need to meet the following specification: 

Class Name: RNumber 

 Assume integer values only 

o Unless noted, normal decimal integer values should be assumed 

o Negative values should be displayed in (~ ~), ex: -3 is (~III~) 

o Use normal notation, -5 for instance, on user input 

o For simplicity, assume max value of 1000. 

 Input/Output options 

o Conversations: 

For input of a RNumber object, allow for: 

 setAsRoman( string ) 

 setAsDecimal( int) 

For a RNumber object, produce representations 

 int ToInt() 

 string ToString() 

You should have both a default constructor, as well as a constructor to allow for setting a value at declaration (input should allow for using either an int or a string) 

 Overloaded Operators 

o << 

o >> 

o

o – 

o

o == 

o

o


 


Please Log in! to be able to reply! If you don't have a login, please register here.

YOU CAN ALSO



IN ORDER TO POST!




Within last 365 days
Recommended Popular Threads Controvertial Threads
श्राद्द
TPS Re-registration
सेक्सी कविता - पार्ट २
What are your first memories of when Nepal Television Began?
पाप न साप घोप्टो पारि थाप !!
पुलिसनी संग - आज शनिवार - अन्तिम भाग
निगुरो थाहा छ ??
ChatSansar.com Naya Nepal Chat
TPS Re-registration case still pending ..
Lets play Antakshari...........
What Happened to Dual Citizenship Bill
Basnet or Basnyat ??
Sajha has turned into MAGATs nest
NRN card pros and cons?
मेरो अम्रिका यात्रा -२
Do nepalese really need TPS?
कता जादै छ नेपाली समाज ??
susta manasthiti lai ke bhanchan english ma?
कृष्ण नै अन्तिम सत्य
पुलिसनी संग - आज शुक्रवार - भाग २
Nas and The Bokas: Coming to a Night Club near you
राजदरबार हत्या काण्ड बारे....
Mr. Dipak Gyawali-ji Talk is Cheap. US sends $ 200 million to Nepal every year.
Harvard Nepali Students Association Blame Israel for hamas terrorist attacks
TPS Update : Jajarkot earthquake
is Rato Bangala school cheating?
NOTE: The opinions here represent the opinions of the individual posters, and not of Sajha.com. It is not possible for sajha.com to monitor all the postings, since sajha.com merely seeks to provide a cyber location for discussing ideas and concerns related to Nepal and the Nepalis. Please send an email to admin@sajha.com using a valid email address if you want any posting to be considered for deletion. Your request will be handled on a one to one basis. Sajha.com is a service please don't abuse it. - Thanks.

Sajha.com Privacy Policy

Like us in Facebook!

↑ Back to Top
free counters