Question

Please do not write any code. I just need to understand what the challenge is asking...

Please do not write any code. I just need to understand what the challenge is asking for.  I am lacking the domain of knowledge for this challenge. If someone can kindly clarify great it for me, that be would a great help.

This challenge is from the book Object-Oriented Programming in c++ Fourth Edition by Robert Lafore

/*In the heyday of the British Empire, Great Britain used a monetary system based on
pounds, shillings, and pence. There were 20 shillings to a pound, and 12 pence to a
shilling. The notation for this old system used the pound sign, £, and two decimal points,
so that, for example, £5.2.8 meant 5 pounds, 2 shillings, and 8 pence. (Pence is the plural
of penny.) The new monetary system, introduced in the 1950s, consists of only pounds
and pence, with 100 pence to a pound (like U.S. dollars and cents). We’ll call this new
system decimal pounds. Thus £5.2.8 in the old notation is £5.13 in decimal pounds (actually
£5.1333333). Write a program to convert the old pounds-shillings-pence format to
decimal pounds. An example of the user’s interaction with the program would be
Enter pounds: 7
Enter shillings: 17
Enter pence: 9
Decimal pounds = £7.89

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Here is explanation for approaching this problem:

Basically first you have to convert Pence to Shillings and then add both the shillings and then convert shillings to pound and and then add to the pound entered by user.

Let's take an example given in the question:

Enter pounds: 7
Enter shillings: 17
Enter pence: 9

You have 17 shillings and 9 pence.

First you convert pence to shillings and add this to the shilling entered by user to get total shilling :

1 shilling = 12 pence,

1 pence = 1/12 shilling

so 9 pence = 9/12 shilling = 0.75 shillings

Now add the shillings 17 (user entered) + 0.75 (converted from pence) = 17.75 shillings

So now convert this shillings to pound.

1 Pound = 20 shillings

1 shillings = 1/20 pounds

so 17.75 shillings = 17.75 * (1/20) = 0.8875 = 0.89 (rounded to two decimal)

Now you shilling and pence converted to Pound. Add both the pounds

7 (actual pound entered by the user) + 0.89 (converted from shilling and pence) = 7.89

In case any query do comment. Please rate answer. Thanks

Add a comment
Know the answer?
Add Answer to:
Please do not write any code. I just need to understand what the challenge is asking...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT