Conversion between currency systems

This is a discussion on Conversion between currency systems within the C++ Programming forums, part of the General Programming Boards category; this is a program i have to write, and im stuck and its due tomorrow at 9 am. heres the ...

  1. #1
    Registered User
    Join Date
    Feb 2012
    Posts
    1

    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;
    }

  2. #2
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    20,975
    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.
    C + C++ Compiler: MinGW port of GCC
    Version Control System: Bazaar

    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  3. #3
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,338
    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?
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  4. #4
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,338
    I should do something with the title....
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. how to do this currency conversion
    By rashid in forum C Programming
    Replies: 2
    Last Post: 02-22-2010, 09:41 PM
  2. Currency Conversion problem
    By Rich Whitehead in forum C Programming
    Replies: 2
    Last Post: 09-17-2007, 12:40 PM
  3. Currency Conversion
    By roadrunnr70 in forum C Programming
    Replies: 8
    Last Post: 12-16-2004, 02:47 PM
  4. Currency Conversion Program
    By Dangerous_Dave in forum C Programming
    Replies: 2
    Last Post: 11-11-2003, 07:54 PM
  5. Currency Conversion Program
    By kgraw21 in forum C Programming
    Replies: 5
    Last Post: 04-19-2002, 08:39 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21