We connect with computers through coding, often known as computer programming.
<h3>How to code?</h3>
- We connect with computers through coding, often understood as computer programming.
- Coding exists similar to writing a set of instructions because it instructs a machine what to do.
- You can instruct computers what to do or how to behave much more quickly by learning to write code.
class ICalculator {
int currentValue;
int add(int value) {
this.currentValue = currentValue + value;
return currentValue;
}
int sub(int value) {
this.currentValue = currentValue - value;
return currentValue;
}
int mul(int value) {
this.currentValue = currentValue * value;
return currentValue;
}
int div(int value) {
this.currentValue = currentValue / value;
return currentValue;
}
}
public class ICalculator2 extends ICalculator {
int negate() {
if (currentValue != 0)
this.currentValue = -currentValue;
return currentValue;
}
public static void main(String[] args) {
ICalculator2 ic = new ICalculator2();
ic.currentValue=5;
System.out.println(ic.add(2));
System.out.println(ic.sub(5));
System.out.println(ic.mul(3));
System.out.println(ic.div(3));
System.out.println(ic.negate());
}
}
To learn more about code, refer to
brainly.com/question/22654163
#SPJ4