Modify the definition of the class romantype

Assignment Help Operation Management
Reference no: EM13762626

1-Write a program that converts a number entered in Roman numberals to decinal form. Your program should consist of a class, say romanType. An object of rmanType should do the following:

a- Store the number a s a Roman numeral.

b- Convert and store the number into decimal form.

c- Print the number as a Roman numeral or decimal number as reqeusted by the user. (Write two separate funtions-one to print the number as a Roman numeral and the other to print the number as a decimal number.)

The decimal values of the Roman numerals are:

M. 1000

D 500

C 100

L 50

X 10

V 5

I 1

Remember the larger numeral preceding a smaller numeral means addition, so LX is 60. A smaller numeral preceding a larger numeral means subtraction, so XL is 40. Any place in a decinal number such as 1s place, the 10s place, and so on, requires zero to four Roman numerals.

d. Test your program using the folowing Roman numerals: MCXIV, CCCLIX, and MDCLXVI

2- Write the definition of the class dayType that implements the day of the week in a program. The class dayType should store the day, such as Sunday for Sunday. The program should be able to perform the following operations on an object of type dayType:

a. Set the day.

b. Print the day.late and return the day by adding . t larly, if today is Tuesday and we add 13 days, to da, the day to be returned is Froda days to the current day. For example, if the current day is Monday and we add 4 day

c. Return the day.

d. Return the next day

e. Return the previous day

f. Calculate and return the day by adding certain days to the current day. For example, if the current day is Monday and we add 4 days, the day to be returned is Friday. Similarly, if today is Tuesday and we add 13 days, the day to be returned is Monday.

g.Add the appropriate constructors.

3- Write the definitions of the functions to implement the operations for the class dayType as defined in Programming Execuse 2, Also, write a program to test various operations on this class.

Chapter 2:

1- Int his chapter, the class dateType was designed to implement the date in a program, but the member function setDate and the constructor do not check whether the date is valid before storing the date in the data members. Rewrite the definitions of the function setDate and the construcor so that the values for the month, day, and year are checked before storing hte date into the data menbers. Add a function member, isLeapYear, to check whether a year is a leap year. Moreover, write a test program to test your class.

2-In programming exercise 2, the class dateType was designed and implemented to keep track of a date, but it has very limited operations. Redefine the class dateType so that it can perform the following operations on a date in addition to the operations already defined:

a- Set the month

b- Set the day.

c- Set the year.

d- Returnt he month

e- Return the day

f- Return the year

g- Test whether the year is a leap year.

h. Return the number of days in the month. For example, if the date is 3-12-2011, the number of days to be returned is 31 because there are 31 days in March.

i. Return the number of days passed in the year. For example, if the date is 3-18-2011, the number of days passed in the year is 77. Note that the number of days returned also includes the current day.

j. Return the number of days remaining in the year. For example, if the date is 3-18-2011, gthe number of days remaining in the year is 288.

k. Calculate the new date by adding a fixed number of days to the datre. For example, f the date is 3-18-2011 adn the days to be added are 25, the new date is 4-12-2011.

a. In Programming Execise 1 in Chapter 1, we defined a class romanType to implement Roman numberals in a program. Int hat exercise, we also implement Roman numerals ina program. In that exercise, we also implemented a function, rmanToDecimal, to cnvert a Roman numberal into its equivalent decimal number.

Modify the definition of the class romanToDecimal, to convert a Roman numeral into its equivalent decimal number.

Modify the definition of the class romanType so that the data membersare declared as protecred. Use the class string to maniputlate extraction operators for easy input and output. The stream insertion operator outputs the Roman numberal in the Roman format.

Also, include a member function, decimalToRman, that converts the decimal number (the decimal number must be a positive integer) to an equivalent Roman numeral format. Wrtie the definition of hte member function decimalToRoman.

For simplicity, we assume that onlyt he letter I can appear in from of another letter and that it appears only in fromt o f the letters V and X. For example, 4 is represented as XXXXIX. Also, 40 will be represented as XXXX, 190 will be representes as CLXXXX, and so on.

Reference no: EM13762626

Questions Cloud

Regulation to ensure fairness in the low-calorie : Examine the major effects that government policies have on production and employment. Predict the potential effects that government policies could have on your company.
Java programmer for a software company : Imagine that you work as a Java programmer for a software company. Your company is developing a new interactive learning management tool called uGrade
Write summary of lack of marketing strategy : Write summary of Lack of Marketing strategy and The ASRS system that Jack has chosen is expensive. The summary should summarize the recommendations to fix/improve them.
Payable to borrow for a major expansion : Williams is planning to issue $620,000 of 5%, five-year bonds payable to borrow for a major expansion. The owner, Williams Robinson, asks your advice on some related matters.
Modify the definition of the class romantype : Modify the definition of the class romanType so that the data membersare declared as protecred. Use the class string to maniputlate extraction operators for easy input and output. The stream insertion operator outputs the Roman numberal in the Rom..
Explain how you determined that the selected organization : Examine the culture of the selected organization and explain how you determined that the selected organization showed the signs of the culture that you have identified.
Using business students as consultants : Examine the four (4) managerial functions and determine which one (1) you believe to be the most important. Provide two (2) examples to support your choice. Suggest one (1) action you will take in order to implement your choice into your current o..
Develop strategies for entering the target market : Describe the specific target market - Develop strategies for entering the target market
State and federal elections : Opinion polls attempt to predict the results of local, state and federal elections. Discuss six reasons why the results of the opinion poll and the outcome of the election may differ.

Reviews

Write a Review

Operation Management Questions & Answers

  What is the probability the next circuit board

What is the probability the next circuit board that is kicked to the waste bin will occur in 3 minutes or more, 6 minutes or more, or 12 minutes or more?

  Describe how arbitration works

Elucidate also describe how arbitration works also elucidate how it may benefit or hinder either side. Illustrate what current event can you reference where arbitration has settled the dispute

  What is the theoretical minimum number of workers required

An assembly line has 5 operations with total work content of 5.62 min. The demand is 30 units/8hour shift. What is the theoretical minimum number of workers required on this line?

  Analyze this data using an appropriate control chart

Each week a sample of 100 residents is questioned on their feelings towards project. Results to date are shown below. Analyze this data using an appropriate control chart with a 5% risk of Type I error.

  Evaluate the concept of administrative liaison officer

The human resource department was created by a governor of one of the fifty states. The reorganization consolidated 19 separate units into The Bureau for Administration and Operations.

  Describe the role that the cdc

Describe the role that the CDC and the United States Department of Health and Human Services (HHS) play in the matters of infectious disease, airborne and foodborne pathogens, and public health.

  Describes the whole research process

Discuss how the research questions and hypothesis are developed. Describe the null and alternative hypothesis and how they support the research effort. Describe how the research effort will be measured and analyzed.

  Describe a conflict within an organization or team

Describe a conflict within an organization or team with which you are familiar. Identify and describe the source(s) and level of the conflict and support with evidence.

  What is the minimum annual production level

Assume five-year SL depreciation (SV5 = 0), an effective income tax rate of 40%, and an after-tax MARR of 10% per year.

  Determine the break-even point for each range

Determine the break-even point for each range. If estimated demand is 90 to 120 customers per day, how many machines should be purchased?

  What order size would you recommend

A manager just received a new price list from a supplier. It will now cost $1.00 a box for order quantities of 801 or more boxes, $1.10 a box for 200 to 800 boxes, What order size would you recommend

  Discuss how employees effectively execute the strategy

Select a company that you believe uses its employees to achieve a competitive advantage. Discuss how the employees effectively execute the strategy and how the company can sustain this position over time.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd