Write a program to calculate the voltage when the value of electric current and resistance
import java.util.Scanner;
public class App {
/**
* The start point of the program
*
* @param args
*
*/
public static void main(String[] args) {
Scanner keyBoard = new Scanner(System.in);
System.out.print("Enter the electric current (I): ");
double I = keyBoard.nextDouble();
System.out.print("Enter the electric resistance (R): ");
double R = keyBoard.nextDouble();
double U = I * R;
System.out.print("Enter the electric voltage (U): " + U);
keyBoard.close();
}
}
Comments
Leave a comment