CURRENCY CONVERTER - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

CURRENCY CONVERTER

MUNNEYACEMUNNEYACE GHANAPosts: 1Member

Currency Converter project Write a menu-driven program for currency exchange management in either C or C++. It consists of following features: a) set exchange rate b) convert one currency to another c) update currency and exchange rate d) add more currency and exchange rate e) prints out transactions for end of day

Comments

  • MUNNEYACEMUNNEYACE GHANAPosts: 1Member

    include<stdio.h>

    include<stdlib.h>

    void setrate(); void convert(); char dollar[15]="DOLLAR"; char ghanac[15]="GHANA CEDIS"; char pound[15]="POUND"; char euro[15]="EURO"; char convert1[10],convert2[10],convert3[10],convert4[4]; float dotopo,dotogh,dotoeu; float ghtodo,ghtopo,ghtoeu; float eutopo,eutogh,eutodo; float potogh,potoeu,potodo; int main() { while(1) { int gh; printf("\n\n\n\n"); printf("\tMENU\n"); printf("=======================================\n"); printf("1.SET EXCHANGE RATE\n"); printf("2.CONVERT ONE CURRENCY TO ANOTHER\n"); printf("3.UPDATE CURRENCY AND EXCHANGE RATE\n"); printf("4.ADD MORE CURRENCY AND EXCHANGE RATE\n"); printf("5.PRINT OUT TRANSACTIONS FOR END OF DAY\n"); printf("6.QUIT\n\n"); printf("=======================================\n"); printf("PLEASE SELECT YOUR CHOICE: "); scanf("%d", &gh); switch(gh) { case 1: printf("\n"); printf("SET EXCHANGE BASE RATE\n"); printf("=======================================\n"); setrate(); break; case 2: printf("\n"); printf("CONVERTING ONE CURRENCY TO ANOTHER\n"); printf("=======================================\n"); convert(); break; case 3: printf("\n"); printf("UPDATE\n"); printf("=======================================\n");

            break;
        case 4:
            printf("\n");
            printf("MORE CURRENCY\n");
            printf("=======================================\n");
    
            break;
        case 5:
            printf("\n");
            printf("PRINT OUT\n");
            printf("=======================================\n");
    
            break;
        case 6:
           // savealldata();
            printf("\n");
            printf("BYE!!! SEE YOU AGAIN :-)");
            exit(1);
            default:
            printf("you entered a wrong choice\n");
            break;
      }
    
    }
    return 0;
    

    }

    void setrate() { int n; int d,f,h,j; printf("PLEASE SELECT YOUR CURRENCY:\n"); printf("1.DOLLAR\n"); printf("2.GHANA CEDIS\n"); printf("3.POUND\n"); printf("4.EURO\n"); printf("PLEASE ENTER YOUR CHOICE: "); scanf("%d", &n); switch(n) { case 1: printf("=======================================\n"); printf("WHAT CURRENCY WOULD YOU WANT TO SET\n"); printf("1.DOLLAR\n"); printf("2.GHANA CEDIS\n"); printf("3.POUND\n"); printf("4.EURO\n"); printf("PLEASE ENTER YOUR CHOICE\n"); scanf("%d", &d); switch(d) { case 1: if(d=1) { printf("YOU CAN'T SET DOLLAR TO DOLLAR\n"); printf("=======================================\n"); setrate(); break; } case 2: printf("SET DOLLAR TO GHANA CEDIS\n"); printf("1 DOLLAR is worth in GHANA CEDIS :"); scanf("%f", &dotogh); break; case 3: printf("SET DOLLAR TO POUND\n"); printf("1 DOLLAR is worth in POUND :"); scanf("%f", &dotopo); break; case 4: printf("SET DOLLAR TO EURO\n"); printf("1 DOLLAR is worth in EURO :"); scanf("%f", &dotoeu); break; default: printf("YOU ENTERED A WRONG INPUT\n"); break; break; } break; case 2: printf("=======================================\n"); printf("WHAT CURRENCY WOULD YOU WANT TO SET\n"); printf("1.DOLLAR\n"); printf("2.GHANA CEDIS\n"); printf("3.POUND\n"); printf("4.EURO\n"); printf("PLEASE ENTER YOUR CHOICE\n"); scanf("%d", &f); switch(f) { case 2: if(f=2) { printf("YOU CAN'T SET GHANA CEDIS TO GHANA CEDIS\n"); setrate(); break; } case 1: printf("SET GHANA CEDIS TO DOLLAR\n"); printf("1 GHANA CEDIS is worth in DOLLAR :"); scanf("%f", &ghtodo); break; case 3: printf("SET GHANA CEDIS TO POUND\n"); printf("1 GHANA CEDIS is worth in POUND :"); scanf("%f", &ghtopo); break; case 4: printf("SET GHANA CEDIS TO EURO\n"); printf("1 DOLLAR is worth in EURO :"); scanf("%f", &ghtoeu); break; default: printf("YOU ENTERED A WRONG INPUT\n"); break; } break; case 3: printf("=======================================\n"); printf("WHAT CURRENCY WOULD YOU WANT TO SET\n"); printf("1.DOLLAR\n"); printf("2.GHANA CEDIS\n"); printf("3.POUND\n"); printf("4.EURO\n"); printf("PLEASE ENTER YOUR CHOICE\n"); scanf("%d", &h); switch(h) { case 3: if(h=3) { printf("YOU CAN'T SET POUND TO POUND\n\n"); setrate(); break; } case 2: printf("SET POUND TO GHANA CEDIS\n"); printf("1 POUND is worth in GHANA CEDIS :"); scanf("%f", &potogh); break; case 1: printf("SET POUND TO DOLLAR\n"); printf("1 DOLLAR is worth in POUND :"); scanf("%f", &potodo); break; case 4: printf("SET POUND TO EURO\n"); printf("1 POUND is worth in EURO :"); scanf("%f", &potoeu); break; default: printf("YOU ENTERED A WRONG INPUT\n"); break; } break; case 4: printf("=======================================\n"); printf("WHAT CURRENCY WOULD YOU WANT TO SET\n"); printf("1.DOLLAR\n"); printf("2.GHANA CEDIS\n"); printf("3.POUND\n"); printf("4.EURO\n"); printf("PLEASE ENTER YOUR CHOICE\n"); scanf("%d", &j); switch(j) { case 4: if(j=4) { printf("YOU CAN'T SET EURO TO EURO\n\n"); setrate(); break; } case 2: printf("SET EURO TO GHANA CEDIS\n"); printf("1 EURO is worth in GHANA CEDIS :"); scanf("%f", &eutogh); break; case 1: printf("SET EURO TO DOLLAR\n"); printf("1 EURO is worth in POUND :"); scanf("%f", &eutodo); break; case 3: printf("SET EURO TO POUND\n"); printf("1 EURO is worth in POUND :"); scanf("%f", &eutopo); break; default: printf("YOU ENTERED A WRONG INPUT\n"); break; } break; default: printf("YOU ENTERD A WRONG INPUT"); setrate(); break; } }

    }

    THIS IS WHAT I HAVE STARTED WITH SO FAR. CAN SOMEONE PLEASE HELP ME OUT

Sign In or Register to comment.