Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.io.*;
- import java.util.*;
- public class Main {
- public static void main(String[] args) throws IOException {
- malachi();
- BufferedReader BR= new BufferedReader (new InputStreamReader(System.in));
- System.out.println("Give an a value: ");
- int a= (int)Double.parseDouble(BR.readLine());
- System.out.println("Give a b value");
- int b= (int)Double.parseDouble(BR.readLine());
- stranded(a,b);
- }
- public static void malachi() {
- System.out.println("Please type a message here: \n");
- Scanner scanner = new Scanner(System.in);
- String message = scanner.nextLine();
- }
- public static void stranded(int a, int b){
- int sum=a*b;
- int sum2= (int) Math.pow(a,b);
- System.out.println("The product is: "+ sum);
- System.out.println("a to the power of b is: " + sum2);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement