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!
- 3 Contributors
- forum7 Replies
- 297 Views
- 1 Day Discussion Span
- commentLatest PostLatest Postby mprabuw
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 PostYou 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.
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.
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)