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

Thread: questions -- urgent and important

  1. #1
    Join Date
    May 2012
    Posts
    0

    questions -- urgent and important

    hi,

    new to VB. have some questions that i need help with. please help me.

    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. #2
    Ejaz's Avatar
    Ejaz is offline Elite Member Power Poster
    Join Date
    Jul 2002
    Location
    Lahore, Pakistan
    Posts
    4,211

    Re: questions -- urgent and important

    Quote Originally Posted by jchou729 View Post
    new to VB. have some questions that i need help with.
    This is Visual C++ forum. Please ask a mod to move your thread to relevant board.

  3. #3
    Join Date
    Sep 2004
    Location
    Holland (land of the dope)
    Posts
    4,123

    Re: questions -- urgent and important

    Quote Originally Posted by Ejaz View Post
    This is Visual C++ forum. Please ask a mod to move your thread to relevant board.
    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
  •  


Azure Activities Information Page

Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center