Discount Get BMIS 209 ALL WEEKS Solution ONLY $99.99 $121.93
BMIS 209 Week 1 - Write an application that asks the user to ente... [$9.99]
BMIS 209 Week 2 - Develop a C# application that inputs one salesp... [$15.99]
BMIS 209 Week 3 - Write a recursive method called Power(base, exp... [$15.99]
BMIS 209 Week 4 - Create a class called SavingsAccount [$19.99]
BMIS 209 Week 5 - Create an inheritance hierarchy that a bank mig... [$19.99]
BMIS 209 Week 6 - Develop a polymorphic banking application using... [$19.99]
BMIS 209 Week 7 - Based on the program you created for Assignment... [$19.99]
BMIS 209 Week 8 - General Background Information [$29.99]
Get Selected Weeks Solution with ONLY NOT Add Selected Tutorials To Cart
BMIS209 BMIS 209 BMIS/209 - Assignment 3 - Week 3 - Module 3 - Write a recursive method called Power(base, exponent) that, when called, returns  base exponent
    BMIS209 BMIS 209 BMIS/209 - Assignment 3 - Week 3 - Module 3 - Write a recursive method called Power(base, exponent) that, when called, returns  base exponent

BMIS209 BMIS 209 BMIS/209 - Assignment 3 - Week 3 - Module 3 - Write a recursive method called Power(base, exponent) that, when called, returns base exponent

$15.99

BMIS409

Programming Assignment 3 Instructions

Write a recursive method called Power(base, exponent) that, when called, returns  base exponent .

For example, Power ( 3, 4 ) = 3 * 3 * 3 * 3. 

Assume that exponent is an integer greater than or equal to 1.  The recursion step should use the relationship:

base exponent = base * base exponent – 1

The terminating condition occurs when exponent is equal to 1 because

base 1 = base

Incorporate this method into an application that enables the user to enter the base and exponent.

 Requirements:

In the Main() method, declare three arrays of long data types:  baseNumbers, exponents, and results.  Each array should be created to hold exactly 5 members.

Using a FOR loop, populate the baseNumbers array with random integers between 1 and 50 and populate the exponents array with random integers between 1 and 10.  Use a random number generator to create these random numbers.

Using another FOR loop, call the Power method, passing it a member of the baseNumbers array and a member of the exponents array for each iteration of the loop.  Store the returned values in the results array.

The Power method should use the algorithm described above and MUST be recursive, taking two longs as arguments and returning a long data type.

Create another method called PrintArrays that takes as arguments the three arrays you created above and returns void.  The method should print a header as “Base”, “Exponent”, and “Result” with each word separated with a single tab character.  Using a FOR loop, iterate over each array using the GetUpperBound method to determine the condition for which the loop terminates.  For each iteration of the loop, print out the base, exponent, and result from each array under the appropriate column headings.  (Hint:  You may need to use one or more tabs to separate the data values to make them line up with the headers above.)

The Main() method should call the PrintArrays method, passing in the three arrays as arguments.

Your output should resemble the example below:

A note on the assignment.  You are required to write a function called 'Power' that uses recursion to find the answer when given a base number and an exponent.  You are to write this function.  Do not use the function that is contained in the .NET libraries.  And yes, it has the same name.  I know it would be so much easier to use the built in function, but that is not the requirement.  If you do use the .NET function, you will not pass the assignment

Solution for BMIS209 Assignment 3

Solution contain Visual Studio C# project (you can open and run this project by Visual Studio 2010 or newest version)

It is 100% correct.

If you have more questions, please contact me via email support@extutorials.com

I will help you any time

Thanks

Attached Files

Move over [ preview ] file name to preview content in it!

Write a review

Your Name:


Your Review: Note: HTML is not translated!

Rating: Bad           Good

Enter the code in the box below:



PURCHASE SAVE
2 Tutorials 10%
3 Tutorials 13%
4 Tutorials 16%
5 Tutorials 19%
6 Tutorials 22%
7 Tutorials 25%
8 Tutorials 28%
9 Tutorials 31%
10 Tutorials 34%
add url more

9MZQASHWN73B