Progress on module: 6)
This commit is contained in:
parent
9d3f15ca88
commit
578cdc0153
|
@ -0,0 +1,15 @@
|
|||
package net.stelian.m319.projectThree;
|
||||
import java.lang.Math;
|
||||
import java.util.Scanner;
|
||||
public class Potenzen {
|
||||
public static void main(String[] args) {
|
||||
Scanner input = new Scanner(System.in);
|
||||
// a^b=c
|
||||
System.out.println("Enter a base: ");
|
||||
double a = input.nextDouble();
|
||||
System.out.println("Enter an exponent: ");
|
||||
double b = input.nextDouble();
|
||||
double c = Math.pow(a,b); // a) c wird als double ausgegeben
|
||||
System.out.println("Result: "+c); // b) Zahl zu gross, Result: Infinity
|
||||
}
|
||||
}
|
Binary file not shown.
Loading…
Reference in New Issue