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] Kth Smallest Difference Contest Problem](https://realcoder.techss24.com/wp-content/uploads/2022/06/Solved-Kth-Smallest-Difference-Contest-Problem-300x200.png)
![Write a class ElementCheckInEveryPair with a public method checkElement that takes two parameters one is arr of type int[] and second one is arg of type int and returns true if every pair of arr contains at least one arg](https://realcoder.techss24.com/wp-content/uploads/2022/06/Write-a-class-ElementCheckInEveryPair-with-a-public-method-checkElement-that-takes-two-parameters-one-300x200.png)
