# Conversion between currency systems

• 02-06-2012
Perry Neal
Conversion between currency systems
this is a program i have to write, and im stuck and its due tomorrow at 9 am. heres the assignment description and what i have so far.

ITCS-2530 Assign #1 - consists of two programs:

Prog 1A - 20 points

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 pural for penny).) The new monetary system, introduced in the 1950s, consists only of 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 old notation is 5.13 in decimal pounds (actually 5.133333). Write a program to convert the old pounds-shillings-pence format to decimal pounds. An example of user's interaction is as follows: [call it I/O Figure #1A for the specs.]

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

Result in Decimal pounds = £7.89

Code:

```#include <iostream> using namespace std;   int pounds; int shillings; int pence; double decimalpounds; float totalpence int main() {     cout << "enter number of pounds";     cin >> pounds;         cout << "enter number of shillings";     cin >> shillings;         cout << "enter number if pence";     cin >> shillings             totalpence = pounds*240 + shilling*12 + pence         decimalpounds = totalpence         cout << decimalpounds           return 0; }```
• 02-06-2012
laserlight
What are you stuck on?

By the way, avoid telling people that you need to get something done by a specific deadline. Some may deliberately answer you only once the deadline is past. After all, the deadline is your problem, not ours.
• 02-06-2012
Salem
So apart from a bunch of missing ; to make it compile, what's your question about your code?

What do you see when you run it, and how is it wrong?
• 02-06-2012
Salem
I should do something with the title....