The case of x⁰=1 is one you shouldn't overlook!
double powerto(double f, int exponent)
{
if (exponent < 0) { return 0; }
if (exponent == 0) { return 1.0; }
while (--exponent > 0) { f *= f; }
return f;
}
Answer:
ok
Explanation:
did it. It was a little difficult to keep my pencil straight.
Answer:
Explanation: Microsoft Excel is a spreadsheet program included in the Microsoft Office suite of applications. Spreadsheets present tables of values arranged in rows and columns that can be manipulated mathematically using both basic and complex arithmetic operations and functions.
<span>What is Aggregate Demand equivalent to?
A. Real Output</span>
Answer:
public static void vowelsConsonantCount(String str){
String text = str.toLowerCase();
String word = text.replaceAll("[^a-zA-Z0-9]", "");
int lenWord = word.length();
int count = 0;
for(int i=0; i<lenWord; i++){
if(word.charAt(i)=='a'||word.charAt(i)=='e'||word.charAt(i)=='i'
||word.charAt(i)=='o'||word.charAt(i)=='u'){
count++;
}
}
int consonants = lenWord-count;
System.out.println("the total vowels are "+count);
System.out.println("The total consonants are: "+consonants);
}
Explanation:
- In Java programming language
- The method uses java's replaceAll() method to remove all spaces and special characters and punctuations.
- It converts the string entered into all lower cases using toLowerCase() method
- Calculates the length of the resulting string using the length() method
- Using if statement the total vowels are counted, subtracting the total vowels from the size of the string gives the total consonants
- These two values are outputed.