Answer:
In Python:
numberOfWholeSlices = int(22/7)
print(numberOfWholeSlices )
Explanation:
For each friend to get a whole number of slices, we need to make use of the int function to get the integer result when the number of slices is divided by the number of people.
So, the number of slice is: 22/7
In python, the expression when assigned to numberOfWholeSlices is:
numberOfWholeSlices = int(22/7)
Next, is to print the calculated number of slices
print(numberOfWholeSlices )
If a run-time error appears when you run a macro that has worked in the past, some part of the macro code no longer makes sense to excel, ehere run-time denotes <span> the time during which a program is running</span>
This error occurs while the program is running.
Running<span> out of memorywill results in a </span>run-time error.
Answer:
highest of five numbers in the file
Explanation:
- This code reads the file "some-file.txt" and saves the result in variable "somefile"
- The runs a for loop for a count of 5.
- In each loop it compares the current value of the file with the value of the variable result and if the result is true it updates the value of the variable result.
- At the end of this code the variable result will contain the highest value in the file "some-file.txt" and print it.
Answer:
The code is given in the explanation section
Explanation:
//Class Airconditioner
public class AirConditioner {
private boolean turnOnOff;
//The Constructor
public AirConditioner(boolean turnOnOff) {
this.turnOnOff = turnOnOff;
}
//method turn_on
public void turn_on(){
this.turnOnOff = true;
}
//method turn_off
public void turn_off( ){
this.turnOnOff = false;
}
}
// A new class to test the airconditional class
class AircondionTest{
public static void main(String[] args) {
//Creating an object of the Aircondional class
AirConditioner office_a_c = new AirConditioner(false);
//Using the reference varible to call method turn_on
office_a_c.turn_on();
}
}