questions -- urgent and important
 CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com

# Thread: questions -- urgent and important

1. Junior Member
Join Date
May 2012
Posts
0

## questions -- urgent and important

hi,

1. Write a function MyMaxTwo that computes the maximum of two
numbers. Write another function MyMaxEight that computes the
maximum of eight input parameters but only by repeatedly calling the
function MyMaxTwo. In particular, the function MyMaxEight should not
have any If statement. Illustrate the invoking of the function by calling
MyMaxEight(1,2,3,4,8,7,6,5) in the main sub.

2. Write a subroutine that allows the user to query exchange rates across
three currencies. Prepare a spreadsheet that stores a table of exchange
rates across three currencies that the user can fill in before the program
runs. For example to illustrate you could use the following rates :
1 GBP = 1.12952 EUR 1 EUR = 0.885329 GBP
1 GBP = 1.64004 USD 1 USD = 0.609740 GBP
1 USD = 0.688735 EUR 1 EUR = 1.45194 USD
At run time the user simply states the source and destination currencies
and your sub should output to the screen the relevant exchange rate
picked out from the table.

3. e^x also denoted by exp(x) can be approximated by the series
1 + x + (1/2!) x^2 + (1/3!) x^3 + (1/4!) x^4 +…+ (1/N!) x^N
Write a VBA subroutine to compute the sum of this series. Declare all
non-integer numeric variables as type DOUBLE. Allow N to be input by
the user. Validate N, ensuring that it is small enough that it will not give
an overflow error at run time. Output to the screen the error you get in
the approximation for these values i.e. output the difference between the
sum of the series and exp(N). You can illustrate the code with x = 0.5 and
N=5 but these values should not be hard coded.

2. ## Re: questions -- urgent and important

Originally Posted by jchou729
new to VB. have some questions that i need help with.

3. ## Re: questions -- urgent and important

Originally Posted by Ejaz
Also...

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•