Question: This is my C code in putty. I am stuck on what I need to add to my code next. Your task is to write

This is my C code in putty. I am stuck on what I need to add to my code next.

This is my C code in putty. I am stuck on whatI need to add to my code next. Your task is to

Your task is to write a simple international currency converter. The converter will take an unformatted list of five allowable currencies, convert each to their equivalent in U.S. dollars, and print a final total when done. Your converter should understand dollars ('$'), Euros (''), British pounds sterling (''), the Japanese Yen (), and the Indian Rupee ('*'). You should use the getchar library function to read console input one character at a time. The use of any other library functions for input is not recommended at this time. We have provided an example program for your reference, executable on Morbius as brylow/os/Projects/money. Conversions Conversion rates between international currencies change on a daily basis. For the sake of simplicity, we will use the rates that were in effect the day this assignment specification was written: $1000 == 766 or 897 or \109940 or 370845. You may assume that only integer values of currency will be entered, and no decimal points will appear in the input. Likewise, please use only integer arithmetic operations to perform your conversion, and output only truncated integer dollars. (Note that this means an answer of $0.99 is still just output as $0.) const float POUND = 1.31; const float YEN = 0.0091; const float RUPEE = 0.014; const float EURO = 1.11; char c; int currval; float exchangeval; float finval; int printval; float currencyExvhane () { float exchangeRate = 1; c = getchar(); if (c == '$) { printf("s"); return exchangeRate; } else if (c ==' \xC2') { C = getchar(); if (c == '\xA3') { printf(""); exchangeRate = POUND; return exchangeRate; } else if (c == '\xA5') { printf(""); exchangeRate= YEN; 1/printf("the exchange rate is 3f", exchange Rate); return exchangeRate; else{ C = getchar(); c = getchar(); if (c== '\xB9') { printf(""); exchangeRate = RUPEE; return exchangeRate; else if (c == '\xAC') { printf("""); exchangeRate = EURO; return exchangeRate; else { //printf(unknown currency n"); "currencyex.c" 48L, 788C

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!