c++ programming assignment?

1. Two numbers are entered through the keyboard. Write a program to find the value of one number raised to the power of another. (for e.g. if the input is 2 and 4, then the output should be 2*2*2*2 = 16). DO NOT USE the pow( ) function.

2. Given a sequence of characters that end with a symbol #, write a program to count and display the number of uppercase letters, lowercase letters and digits in the given sequence.

Comments

  • 1. Recursive Power Function C++: http://libraryofcprograms.blogspot.com/2013/02/rec...

    2. is really easy.

    Use 3 counters: uppercase_counter, lowercase_counter and digits_counter

    if user inputs in array named 'array' of char do something like this:

    for (int i = 0; array[i]!='#'){

    if (array[i] >='A' && array[i] <= 'Z')

    uppercase_counter++;

    else if

    .............

    else if

    ............

    }

  • btw what uni are you in cuz got almost all your questions i am in American university in sharjah and this is my email [email protected] if you have any questions in physics chemistry or programing you can mail me

  • for (1) if you want to piss off your grader, use

    y = a^b

    ln y = b ln (a)

    y = exp(b ln(a))

    to write a function f(a,b) = exp( b * log(a) )

Sign In or Register to comment.