Dev C++ Currency Converter



Dev c++ currency converter currency

Default: Console.WriteLine('You did not enter a valid currency'); break; EDIT 1: To explain why this doesn't compile, the problem is that you have the statement. Currency USD This statement means compare the variable currency to the variable USD. USD is a double and currency is a string. SDW provides features to access, find, compare, download and share the ECB’s published statistical information. I'm really new to C. I have an assignment, which I think it's very hard to solve. I have to create a Currency Converter Program that reads data from txt files. The program should also be able to read arguments (argv). I'm really confused since it's just a plain text. How can I read it as a database in C?

Hello Dani Web Forum,
I'm really new to C. I have an assignment, which I think it's very hard to solve. I have to create a Currency Converter Program that reads data from txt files. The program should also be able to read arguments (argv[]). I'm really confused since it's just a plain text. How can I read it as a database in C?

The data, which on the 'currency.txt' saved with:

contains:
--------------------------------------------------
DATE | currency | buying rate | selling rate
*not stated in 'currency.txt'
--------------------------------------------------
*actual data:

Until now, I just be able to convert whether it is buying rate or selling rate.

The code above will results all data either buying rates * amount or selling rate *amount, like this:
Game of thrones sezonul 6 episodul 7. It is only can be opened using arguments.

$usermyprogram 18.10.2011 USD 100 2
18.10.2011 = argument 1 = date
USD = argument 2 = currency
100 = argument 3 = amount of money
1 = argument 4 = (1 = buying, 2 = selling)
the result:
-------------------
186.680
189.550
34.344
255.710
207.150
27.909
182.340
676.380
33.041
49.777
243.250
130.740
58.756
5.982
1.751
182.960
184.550
33.799
251.640
287.380
203.220
27.598
179.410
662.900
32.355
48.783
238.590
128.650
58.223
5.865
1.729
----------------------

Actually, it will be described as correct program if I input:
Sample run 1 :
$usermyprogram 18.10.2011 EUR 100 1

Real output should be like this:

Output 1:
254.48

Only one output, which not read all the data like mine did.

I wonder how can I read only 1 line of them?

Please Help me. Thank you very much!

Editedby mprabuw because:n/a
  • 3 Contributors
  • forum7 Replies
  • 297 Views
  • 1 Day Discussion Span
  • commentLatest PostLatest Postby mprabuw
Dev C++ Currency ConverterConverter

Recommended Answers

Welcome to Daniweb :)

Well, you can use a string comparison function. Use strcmp() if allowed or write your own version of it. Microsoft flight simulator x demo.

In this:

… Jump to Post

You do NOT need fseek() . At the beginning of the program, read the data into an array of your CURRENCY structure and you are done with the file. Then you can process all the data you want.

Jump to PostCurrency

All 7 Replies

Welcome to Daniweb :)

Well, you can use a string comparison function. Use strcmp() if allowed or write your own version of it.

In this:

So, do a string comparison this way:


Hope this helps.

**PS: There seems to be a '/TRY' part in each second field. So, you could perhaps concatenate that with Try.curr and then do a string compare. Kindly let me know if i have understood the problem correctly.

Editedby myk45 because:n/a
Most Filipinos have relatives who migrated abroad especially in the US. Most of them migrated because they married foreigners, others migrated because of petitions and there are others who migrated because of work. Being a relative living abroad, there are instances that you need to help your relatives back in your hometown and that means sending money. People receiving money from their relatives living in the other countries, especially first timers, tend to confuse the value of the money they receive. US Dollars is one of the currency holding a high currency exchange rate value in the Philippines. That means one (1) US Dollar can be converted to atleast forty (40)

Dev C++ Currency Converter

Php. But there are instances that the value of US Dollars change due to economic changes as well.
To prevent confusions and to help first timers understand the difference of the two currencies, I made a program that will help people convert currencies easily depending on how much the value of US Dollars are in the Philippines. This program is used with three functions namely main, display and convert. Main function will hold the main program and the other functions hold the conversion and the currency being converted. Check out the codes below.
63:
The program operates as follows. The user will be responsible in entering the right value/amount of one (1)

Dev C Currency Converter Unicode

US Dollar to Philippine Peso. This part should be filled correctly to allow the program to give the user exact answers. The input will be stored in a memory namely pesoValue

Dev C++ Currency Converter Exchange Rate

. This will act as your initial value to be divided or multiplied with your entered amount. The next step will be choosing what to convert, if it is USD to Php or vice versa. After that, it will ask for an amount then the main function now will call on function float convert to do the processing. Your choice will then go through the switch case statements, the one responsible in handling decision making, to look for the specific case in which your choice will fit. Then it will return the result in the main function. Main will also call on the function void display to display the result. After that, you can choose whether to continue with another conversion or terminate the program. You can check out the sample output below.

Converter

Dev C Currency Converter Currency

Hope you learned something. We hope to hear from you. Thanks!