Building an Exponent Method | Java | Tutorial 22

preview_player
Показать описание

Throughout the course we'll be looking at various topics including variables, arrays, getting user input, loops, conditionals, object orientation, and much more.
Рекомендации по теме
Комментарии
Автор

Hi you are the only person that I can learn Java from, other all tutorials about java are so complicated, you teach so clear, thank you! I studied your python videos before and I say fortunately I did, so I can learn easily Java in this way

cansusari
Автор

After learning this function in Mike's C# tutorial...and his Python tutorial, the logic is finally making more sense to me. Third time's a charm, I guess. 😅

scottisitt
Автор

Can you please explain what to do if we want to calculate the power of negative numbers? Great explanation by the way :)

yourtechwizard
Автор

What happens if we do not create result =1 initiallly

pavankarnati
Автор

public class Ame
{
public static void main(String[] args)
{

System.out.println( pow(4, 3));
}

public static int pow(int baseNum, int powNum) {
int result = 1;
for(int i = 0; i < powNum; i++){
result = result * baseNum;
}return result;
}




}

UsaM
Автор

How come you did not assign the VALUES to the variables baseNum and powNum??? I am so confused now

Time_to_Wake_Up
Автор

This is nice
How can u create an exponential method without using exponential methods pls anyone?

opeoluwajoseph
Автор

package mistor;

import java.util.Scanner;

public class java {
public static void main(String [] args) {
Scanner input =new Scanner(System.in);

System.out.print("Enter the number:");
int base = input.nextInt();
System.out.print("Enter the power:");
int pow =input.nextInt();
int result = 1;
for(int i = 0; i < pow; i++) {
result = result * base;
}

}

}
This program can't work whats wrong in it

mistor
Автор

Too bad i am not able to support you from my country !

mukulsharma
Автор

Rip. You are only accepting integers. Why even bother with this.

sadbanana
Автор

I'm sorry 😞, but everyone is saying the same thing you have said in your video. Everyone is using to the power of, and to the exponent of interchangeably, but they're two different things. Take 5⁵ for example. When entered into a calculator as 5↑5 the result is 25, but when entered as 5E5 the result is 500, 000. You may want to make a new video ( generic example ). I know I'm going to have type this comment in at other sites because this makes a half dozen times now, so copied! 🙂

epindigozylacone