# serious help on a program

• 02-24-2002
aly
serious help on a program
on monday i have a program due that converts dollars to deutsche marks and francs, we were given these formulas
\$1.00=5.05 Fr
\$1.00=1.47 DM
1.00= 3.4354 Fr

The problem is that i am really just learing c++ am entirely confused..unsure even where to begin...if anyone could possibly lend some advice to me i would be very very grateful..again this is due monday thanks so much...:confused:
• 02-24-2002
Brian
Please have a look at my code for help, and then attempt it yourself. Otherwise he might be suspicious of cheating and/or you'll never learn C. I'd normally flame, but I'm in a good mood [tired].

Code:

```#include <stdio.h> #define FRANKS 5.05 /* this means anytime you type FRANKS, it is replaced with 5.05 */ #define DM 1.47 /* same here except with DM */ int main(void) {   float input;   int choice;   printf("Enter amount in dollars \$");   scanf("%f",&input); /* get the floating point (%f) input, this is a number with a decimal point (although it doesnt need one) */   printf("Convert to (1)Franks or (2)Deutsche Marks? >");   scanf("%d",&choice); /* get a decimal integer (%d) input, no decimal point */   if(choice == 1)   printf("\$%.2f = %.2fF",input,input*FRANKS); /* * is the symbol for multiplication */   else if(choice == 2)   printf("\$%.2f = %.2fDM",input,input*DM);   else   printf("Invalid choice.");   return 0; }```
• 02-24-2002
pode
u can use functions!
• 02-24-2002
Brian
Quote:

Originally posted by pode
u can use functions!
I know.