Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

Programming Exercises

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

a. Store the number as a Roman numeral.

b. Convert and store the number into decimal form.

c. Print the number as a Roman numeral or decimal number as requested by the user. (Write two separate functions-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: me of type

M 1000

D 500

C 100

L 50

X 10

V 5

I  1

Remember, a 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 decimal number, such as the is place, the 10s place, and so on, requires from zero to four Roman numerals.

d. Test your program using the following 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.

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 Exercise 2. Also, write a program to test various operations on this class.

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M92102393
  • Price:- $30

Priced at Now at $30, Verified Solution

Have any Question?


Related Questions in Computer Engineering

System analysis and design1 provide a scenario in which an

System Analysis and Design: 1) Provide a scenario in which an input display screen is inconsistent and explain how both the user and the organization would suffer as a result as a result. 2) Explain how structured walkth ...

Question suppose we have a system with frequency of

Question : Suppose we have a system with frequency of floating point operations = 35%. What should be the speedup of floating point operation in our design of the next CPU to achieve a desired overall system speedup in t ...

Where do cfos get their money newswhere do cfos get their

Where do CFOs get their money news? Where do CFOs get their money news? According to Robert Half International, 47% get their money news from newspapers, 15% get it from communication/colleagues, 12% get it from televisi ...

Explain how the company newmans own brand fulfills the

Explain how the company Newman's Own brand fulfills the definition of a business for profit and a non-profit business at the same time. Consider in the response the functions of business, entrepreneurship and production ...

Software engineeringyou are a webapp designer for

Software Engineering You are a WebApp designer for FutureLearning Corporation, a distance learning company. You intend to implement an Internet-based "learning engine" that will enable you to deliver course content to a ...

Similar to problem 10 on page 282 assume we have an 8g

Similar to problem 10 on page 282, assume we have an 8G times 64 word addressable computer built using 512M times 32 chips. Memory is addressed using low-order interleave. Answer the following questions. a. How many RAM ...

Question understanding how cloud security differs from

Question: Understanding how cloud security differs from on-premise data center security is crucial for organizational success. What are three (3) key differences between cloud security threats and on-premise security thr ...

Discuss the criteria necessary to establish a factor as a

Discuss the criteria necessary to establish a factor as a confounder and provide an example applying these criteria?

Find minimal dfas for the following languages in each case

Find minimal dfa's for the following languages. In each case prove that the result is minimal. (1) L = {a n bm> :n≥2,m≥1}. (2)L = {a n :n ≥ 0,n ≠ 3} (3) L = {a n :n mod 3 = 0}∪{a n : n mod 5 = 1}

Assignmentthe rebel alliance has secretly been linking

Assignment The Rebel Alliance has secretly been linking planets together via a series of unstable wormholes to enable escape from the Imperial Fleet. The following table lists the wormholes together with the number of pe ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As