How do you make a program that helps a money converter determine the value of a person's money in the selected currency?

1 answer

Answer

1078609

2026-03-01 02:45

+ Follow

#include<stdio.h>

#include<string.h>

main(){

char Peso='P';

char Dollar='USD';

char Euro='E';

char currency[5];

float amount=0;

char currency2[5];

float equivalent;

printf("In what currency is the person's money?\n\t(P)eso\n\t(USD)ollar\n\t(E)uro\n");

scanf("%s",currency);

printf("\nWhat is the amount?\n");

scanf("%f",&amount);

printf("\nIn what currency do you want it changed?\n\t(P)eso\n\t(USD)ollar\n\t(E)uro\n");

scanf("%s",currency2);

if(strcmp(currency,"P")==0 && strcmp(currency2,"USD")==0){

equivalent=amount*0.0237;

printf("The equivalent of his money is P%.2f.\n\n",equivalent);

}

else if(strcmp(currency,"P")==0 && strcmp(currency2,"E")==0){

equivalent=amount*0.0187;

printf("The equivalent of his money is P%.2f.\n\n",equivalent);

}

else if(strcmp(currency,"USD")==0 && strcmp(currency2,"P")==0){

equivalent=amount*42.0006;

printf("The equivalent of his money is P%.0f.\n\n",equivalent);

}

else if(strcmp(currency,"USD")==0 && strcmp(currency2,"E")==0){

equivalent=amount*0.7874;

printf("The equivalent of his money is P%.2f.\n\n",equivalent);

}

else if(strcmp(currency,"E")==0 && strcmp(currency2,"P")==0){

equivalent=amount*53.4804;

printf("The equivalent of his money is P%.2f.\n\n",equivalent);

}

else if(strcmp(currency,"E")==0 && strcmp(currency2,"USD")==0){

equivalent=amount*1.27;

printf("The equivalent of his money is P%.2f.\n\n",equivalent);

}

else

printf("\nWrong Input!\n\n");

}

#include<stdio.h>

#include<string.h>

main(){

int SUV=3500;

int Car=2500;

int Motorcycle=900;

int Truck=4000;

char type[5];

char registration[5];

int ans;

printf("Please select the type of vehicle:\n\tS - SUV\n\tC - Car\n\tM - Motorcycle\n\tT - Truck\n");

scanf("%s",type);

if(strcmp(type,"S")==0 strcmp(type,"s")==0){

printf("\nIs vehicle registered on time?Y/N\n");

scanf("%s",registration);

if(strcmp(registration,"Y")==0 strcmp(registration,"y")==0){

printf("\nTotal Reaistration fee is P%d.\n\n",SUV);

}else if(strcmp(registration,"N")==0 strcmp(registration,"n")==0){

ans=(3500*0.1)+3500;

printf("\nTotal Registration fee is P%d.\n\n",ans);

}else

printf("\ninvalid!\n\n");

}else if(strcmp(type,"C")==0 strcmp(type,"c")==0){

printf("\nIs vehicle registered on time?Y/N\n");

scanf("%s",registration);

if(strcmp(registration,"Y")==0 strcmp(registration,"y")==0){

printf("\nTotal Reaistration fee is P%d.\n\n",Car);

}else if(strcmp(registration,"N")==0 strcmp(registration,"n")==0){

ans=(2500*0.1)+2500;

printf("\nTotal Registration fee is P%d.\n\n",ans);

}else

printf("\ninvalid!\n\n");

}else if(strcmp(type,"M")==0 strcmp(type,"m")==0){

printf("\nIs vehicle registered on time?Y/N\n");

scanf("%s",registration);

if(strcmp(registration,"Y")==0 strcmp(registration,"y")==0){

printf("\nTotal Reaistration fee is P%d.\n\n",Motorcycle);

}else if(strcmp(registration,"N")==0 strcmp(registration,"n")==0){

ans=(900*0.1)+900;

printf("\nTotal Registration fee is P%d.\n\n",ans);

}else

printf("\ninvalid!\n\n");

}else if(strcmp(type,"T")==0 strcmp(type,"t")==0){

printf("\nIs vehicle registered on time?Y/N\n");

scanf("%s",registration);

if(strcmp(registration,"Y")==0 strcmp(registration,"y")==0){

printf("\nTotal Registration fee is P%d.\n\n",Truck);

}else if(strcmp(registration,"N")==0 strcmp(registration,"n")==0){

ans=(4000*0.1)+4000;

printf("\nTotal Registration fee is P%d.\n\n",ans);

}else

printf("\ninvalid!\n\n");

}else

printf("\nInvalid Input!\n\n");

}

#include<stdio.h>

#include<string.h>

main(){

char status[5];

int numChildren;

int tax;

int i=1;

printf("Status of Person: S - Single\n\t\t M - Married\n\t\t H - Head of the Family\n");

scanf("%s",status);

while(i<=status){

i++;

}

if(strcmp(status,"S")==0 strcmp(status,"s")==0){

tax=20000;

printf("\nTotal Tax Exemption: P%d\n\n",tax);

}

else if(strcmp(status,"M")==0 strcmp(status,"m")==0){

printf("\nNo. of Children Under 18:\n");

scanf("%d",&numChildren);

if(numChildren>0){

tax=32000+(8000*numChildren);

printf("\nTotal Tax Exemption: P%d\n\n",tax);

}else{

tax=32000;

printf("Total Tax Exemption: P%d\n\n",tax);

}

}

else if(strcmp(status,"H")==0 strcmp(status,"h")==0){

tax=25000;

printf("Total Tax Exemption: P%d\n\n",tax);

}

else

printf("\nWrong Choice!\n\n");

}

ReportLike(0ShareFavorite

Copyright © 2026 eLLeNow.com All Rights Reserved.