allExponent: You are given a base value and an exponent value. You need to calculate the value of the base raised to the power of the exponent. You need to implement the allExponent method which takes the base value and the exponent value as input and returns the value of the base raised to the power of the exponent.
class Solution
{
float allExponent(int baseValue, int exponentValue)
{
float res = 1;
if(exponentValue >=0)
{
Exponent exp = new Exponent(baseValue, exponentValue);
res = (float)exp.positiveExponent();
}
else
{
// write your code here for negative exponentInput
Exponent exp = new Exponent(baseValue, exponentValue);
res = (float)exp.negativeExponent();
}
return res;
}
}Happy Learning – If you require any further information, feel free to contact me.
![[Solved] allExponent write your code here for negative exponentInput [Solved] allExponent write your code here for negative exponentInput](https://realcoder.techss24.com/wp-content/uploads/2022/11/Solved-allExponent-write-your-code-here-for-negative-exponentInput.png)
![[Solved] Best Couple Event with Java, C++, Python](https://realcoder.techss24.com/wp-content/uploads/2022/07/Solved-Best-Couple-Event-with-Java-C-Python-300x200.png)
![[Solved] You are given two lists of different lengths of positive integers. Write an algorithm to count the number of elements that are not common to each list](https://realcoder.techss24.com/wp-content/uploads/2022/11/Solved-You-are-given-two-lists-of-different-lengths-of-positive-integers.-Write-an-algorithm-to-count-the-number-of-elements-that-are-not-common-to-each-list-300x196.png)
