Answer:
public class Main
{
public static void main(String[] args) {
int userNum = 40;
while(userNum > 1){
userNum /= 2;
System.out.print(userNum + " ");
}
}
}
Explanation:
*The code is in Java.
Initialize the userNum
Create a while loop that iterates while userNum is greater than 1. Inside the loop, divide the userNum by 2 and set it as userNum (same as typing userNum = userNum / 2;). Print the userNum
Basically, this loop will iterate until userNum becomes 1. It will keep dividing the userNum by 2 and print this value.
For the values that are smaller than 1 or even for 1, the program outputs nothing (Since the value is not greater than 1, the loop will not be executed).
Answer:
FileOutputStream out = new FileOutputStream("ObjectData.dat");
ObjectOutputStream ostream = new ObjectOutputStream(out);
ostream.writeObject(r);
Explanation:
For object serialization, we can use the writeObject method of java.io.ObjectOutputStream class.
The complete code fragment is as follows:
import java.io.*;
class Demo{
public static void main(String args[]){
try{
r = <Reference to Object to be serialized> ;
FileOutputStream out = new FileOutputStream("ObjectData.dat");
ObjectOutputStream ostream = new ObjectOutputStream(out);
ostream.writeObject(r);
ostream.close();
} catch(Exception e){
e.printStackTrace();
}
}
}
Answer and Explanation:
Find / -name "IT4983"
See what it will do is it will find the file named IT4983 in the root directory.
run this commmand with sudo just in case for permission issues.
then it will give you the location of that file we want to find.
Or
$ file /home/IT4983 ( you can type this command from whichever directory you are )
output : IT4983 , ASCII TEXT
Answer:
Hardware.
Explanation:
All electronics devices like computer servers, DVDs, smartphones and cell phones, wrist watches etc, comes with two main components, they are hardware and software.
The hardware components are the physical part of the device, while the software component is the written instructions configured to the hardware for executing tasks.
Cleaning the motherboard in a computer system, fixing a DVD, servicing other internal components of devices are all hardware maintenance and repair services.