Create a class CIRCUIT with the following public attributes: total resistance, total voltage and total current. Assign proper variable type and name for each attribute. Total voltage must be static. (static double variablename)
public class Current {
static int total_Voltage;
double total_Current;
private double total_resistance=10;
public static void setVoltageSource() {
total_Voltage = 30;
}
public void getTotal_Current() {
total_Current = total_Voltage / total_resistance;
System.out.println(total_Current);
}
public String getTotalResistance() {
return String.format("to resistance", total_resistance);
}
public void setTotal_Resistance(double total_resistance) {
this.total_resistance = total_resistance;
}
public static void main(String[] args) {
Current cu=new Current();
cu.getTotal_Current();
}
}
Comments
Leave a comment