Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

please C++ programming 1. Before the 1950's, Great Britain used a monetary system based on pounds, shillings, and pence. There were 20 shillings to a

please C++ programming image text in transcribed
1. Before the 1950's, 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, E, and two decimal points, so that, for example, 5.2.8 meant 5 pounds, 2 shillings, and 8 pence. We'll call this system old-pounds. The new monetary system, introduced in the 1950's, consists of only pounds and pence, with 100 pence to a pound (like U.S. dollars and cents). We'll call this system decimal-pounds. So, 5.2.8 in the old-pounds is 5.13 in decimal-pounds. Write a program that asks the user to enter two money amounts expressed in old-pounds and will then add the two amounts and display the answer both in old-pounds and in decimal-pounds. Program requirements: a) Read the numbers into integer variables and then make use of the integer division and remainder (%) operators to do the needed arithmetic for both calculations of the old-pounds sum as well as the decimal-pounds equivalent. b) To read in the old-pound amounts, make use of the fact that the extraction operator>>) can be chained to read in more than one quantity at once. For example: cin >> pound >> doti >> shill >> dot2 >> pence; will read an old-pound amount into integer variables pound, shill, and pence, and read the "dots" into the character variables doti and dot2. Here is an example of a user's interaction with the program: Enter first old-pound amount: 5.10.11 Enter second old-pound amount: 3.19.5 old-pound total = 9.10.4 Decimal-pound total = 9.51

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Online Market Research Cost Effective Searching Of The Internet And Online Databases

Authors: John F. Lescher

1st Edition

0201489295, 978-0201489293

More Books

Students also viewed these Databases questions

Question

What determines how often arecovery tests care conducted.RPO or RTO

Answered: 1 week ago

Question

5. Structure your speech to make it easy to listen to

Answered: 1 week ago

Question

1. Describe the goals of informative speaking

Answered: 1 week ago