Computer Science Homework Solutions
Problem
#55066

Menu based Currency Conversion Program in C

Expand the "Currency Conversion" program to include a menu that allows the user to choose which currency he/she wishes to display in its equivalency to the US dollar. - Correctly use at least 1 function or subroutine

Permit the user to input an amount to be converted into US Dollars.  You may assume that a number is input.  You may not assume the value is > zero.  Only values > zero are valid.

Permit the user to repeatedly perform different conversions to US Dollars.  The user will be provided a way to indicate when they are done & the program will exit
* In Program I am interested in the use of the Do..While an If..Else for the new part. I also realize that the second attached file has a few errors.

Attached file(s):
Attachments
Currency Conversion 1 Assignmet 1.txt  View File
wbA1.c  View File

Attachment Content Summary (Note: view attachment at the above link before purchasing. Actual attachment content may vary slightly from that shown below.)

Currency Conversion 1 Assignmet 1.txt
Currency Conversion Program
The initial Program was created to displays 5 different countries currencies to the US Dollar Exchange rate on October 17,2005
currency to 1 US dollar.
*/

main()

{

// variables for each country for exchange rate
float usa = 1.00;
float brl = 2.2295;
float zar = 0.152952;
float mar = 0.5692;
float mep = 10.8465;
float srl = 101.5;

// results after calculations for printing
float results = 0.00;

// calculate and print results
printf("CURRENCY CONVERSION\n\n");
printf("Foreign Currency to 1 US dollar\n\n");

// Brazilian Real multiplied by 1 US dollar and printed
results = brl * usa;
printf("Brazilian Real %.3f \n", results);

// South African Rand multiplied by 1 US dollar and printed
results = zar * usa;
printf("South African Rand %.3f \n", results);

// Malaysian Ringgit multiplied by 1 US dollar and printed
results = mar * usa;
printf("Malaysian Ringgit %.3f \n", results);

// Mexican Peso multiplied by 1 US dollar and printed
results = mep * usa;
printf("Mexican Peso %.3f \n", results);

// Sri Lanka Rupee multiplied by 1 US dollar and printed
results = sar * usa;
printf("Sri Lanka Rupee %.3f \n", results);

// statement need if running in Mircle C otherwise can be commented out
getchar();

//return statement
return 0;
}

Solution Summary

Demonstrates how to write C code for a Menu driven currency conversion program with input validity.

Solution
What is this?
By OTA - Overall OTA Rating
Purchase Cost Now
$2.19 CAD (was ~$19.95)
Included in Download
  • Plain text response
  • Attached file(s):
    • CurrencyConverter.zip
$2.19 Instant Download
Add to Cart
Why you can trust BrainMass.com
  • Your Information is Secure
  • Best Online Academic Help Service
  • Students find real academic Success
Related Solutions
  • How C supports implicit constructors. - How C supports implicit constructors. Compare this C feature with other languages. How reliable is this feature.
  • ARC subroutine that performs a swap operation - I need help writing an ARC subroutine that performs a swap operation on the 32-bit operands x=25 y=50 which are stored in memory. I need to use as few registers as possible. Thanks!! UPDATE: ...
  • 8080/8085 family - Write an assembly program for the following 8080/8085 family. Include comments. 1. Set the stack pointer address to 4B24h and then call a subroutine. This subroutine will give you a delay of your ...
  • Do not know how to write this code - Write a C program that displays a title, "Currency Conversion", and then writes the names of five currencies and their equivalents to a US dollar. The conversions are hard coded equations. Insert co ...
  • Do 56.6 Kbps modems violate Shannon's Result? Explain. - During the 1940s, Claude Shannon developed Shannon's Result which concluded that phone lines can only handle up to about 35Kbps. During the 1990s it was possible to create 56.6 Kbps modems. Does this ...
Browse