Professional Documents
Culture Documents
Numresults 1
Numresults 1
import javax.swing.*;
System.out.println("base"+" "+"power" +" "+" square root "+" raised to the power of the
second number " );
double c = Math.sqrt(a);
double ab = Math.pow(a,b);
}
Cooldrinks
import javax.swing.JOptionPane;
double a = 7.89;
int b = Integer.parseInt (JOptionPane.showInputDialog ("How many cooldrinks?"));
System.out.println("You ordered: " + b + " cooldrinks");
double c = a * b;
System.out.println("You owe: " + c);
int d = Integer.parseInt (JOptionPane.showInputDialog (" How Would You Like To Pay?"));
double e = d - c;
e=e * 100;
e = Math.round (e);
e = e / 100;
System.out.println("Your change: R" + e);
}
}