Greetings all,

I'm having a little bit of trouble with writing a method that returns the value of a given function. The method is designed to accept an input (int b), then take the input and return the value of a.

a = b + b^2 + 2^b

I've gotten the input portion to work, but the method is where I'm struggling. For the b^2, I'm just going to use b*b. The 2^b is where I'm stuck.

*****************
public int doFunction(int b) {
b + (b*b) + ????
return result
*****************


Thanks for your consideration.

Bud

Thanks :-) I'll give that a try.

Bud

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.