Announcement

Collapse
No announcement yet.

More programing help

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • More programing help

    I need some help here, since I totally suck at programming

    I need to program yet another currency conversion program using loops. All I have set up so far is the Menu to select what demniomation you want to convert into USD. I'm not having any luck trying to figure out to how set up the loop per deminomiaton so it can be converted from USD to that currency when you select it. Basicly You select a currency from the menu then imput how many USD you want to convert to that currency. Heres what I have now:

    Code:
    #include <studio.h>
    
    main()
    {
    	int iSelection = 0;
    	
    	while ( iSelection !=6 ) {
    	
    		printf("1\tBahamian Dollar\n");
    		printf("2\tJamacian Dollar\n");
    		printf("3\tNew Zealand Dollar\n");
    		printf("4\tAustralian Dollar\n");
    		printf("5\tEuro\n");
    		printf("6\tQuit\n");
    		printf("Enter your selection (1-6): ");
    		scanf("%d", &iSelection);
    		
    	} 
    	
    }
    Why is it called tourist season, if we can't shoot at them?

  • #2
    Have you looked into arrays?

    - Steve

    (hint - look into arrays, and possibly structs)

    Comment


    • #3
      Yeah, it's definitely an array solution. You could do it with switch statements, too, but arrays are the more elegant solution here.
      Gigabyte P35-DS3L with a Q6600, 2GB Kingston HyperX (after *3* bad pairs of Crucial Ballistix 1066), Galaxy 8800GT 512MB, SB X-Fi, some drives, and a Dell 2005fpw. Running WinXP.

      Comment

      Working...
      X