currency8: Convert Currencies (UTF-8 Encoding)

Exercise template for converting currencies (EUR, USD, GBP) with various symbols in UTF-8 encoding.

Name:
currency8
Type:
Preview:

On 2013-05-03 one Euro (€) was buying 1.3109 US Dollars ($) and 0.8431 British Pounds (£). At Frankfurter Börse around noon adidas AG was the largest winner compared with the day before with a price of € 84.8492 per share. If you buy 31 shares, how much are they worth in $?

The worth in $ is the number of shares \(\times\) stock price \(\times\) exchange rate, i.e., \(31 \times 84.8492 \times 1.3109 \approx 3448.0933047\).

On 2013-05-03 one Euro (€) was buying 1.3109 US Dollars ($) and 0.8431 British Pounds (£). At Frankfurter Börse around noon adidas AG was the largest winner compared with the day before with a price of € 84.8492 per share. If you buy 85 shares, how much are they worth in £?

The worth in £ is the number of shares \(\times\) stock price \(\times\) exchange rate, i.e., \(85 \times 84.8492 \times 0.8431 \approx 6080.5906442\).

On 2013-05-03 one Euro (€) was buying 1.3109 US Dollars ($) and 0.8431 British Pounds (£). At Frankfurter Börse around noon adidas AG was the largest winner compared with the day before with a price of € 84.8492 per share. If you buy 99 shares, how much are they worth in €?

The worth in € is the number of shares \(\times\) stock price \(\times\) exchange rate, i.e., \(99 \times 84.8492 \times 1 \approx 8400.0708\).

Description:
Computing the worth of a randomly drawn number of shares in a certain currency. The main purpose of the exercise is to illustrate and test whether UTF-8 encoding works correctly.
Solution feedback:
Yes
Randomization:
Random numbers and text blocks
Mathematical notation:
Yes
Verbatim R input/output:
No
Images:
No
Other supplements:
No
Raw: (1 random version)
PDF:
currency8-Rmd-pdf
currency8-Rnw-pdf
HTML:
currency8-Rmd-html
currency8-Rnw-html

(Note that the HTML output contains mathematical equations in MathML, rendered by MathJax using ‘mathjax = TRUE’. Instead it is also possible to use ‘converter = “pandoc-mathjax”’ so that LaTeX equations are rendered by MathJax directly.)

Demo code:

library("exams")

set.seed(403)
exams2html("currency8.Rmd", mathjax = TRUE)
set.seed(403)
exams2pdf("currency8.Rmd")

set.seed(403)
exams2html("currency8.Rnw", mathjax = TRUE)
set.seed(403)
exams2pdf("currency8.Rnw")