Posts

Showing posts from July, 2024

File operation

 import java.io.*; import java.util.Scanner; class FS {     public static void main(String[] args) {         Scanner scanner = new Scanner(System.in);         String fileName = "msc1.txt";         int choice;         do {             System.out.println("\nFile Operations Menu:");             System.out.println("1. Create a File");             System.out.println("2. Write to the File");             System.out.println("3. Read from the File");             System.out.println("4. Update the File");             System.out.println("5. Delete the File");             System.out.print("Enter your choice: ");             choice = scanner.nextInt();     ...

Qu.java

 import java.lang.*; import java.io.*; class Questions{ public String [][]qpa; public String[][]qca;  Questions()throws IOException { qpa=new String[10][5]; /*questionsandobjectives*/ DataInputStream in=new DataInputStream(System.in); qpa[0][0]="what is brain of computer?"; qpa[0][1]="1.cpu"; qpa[0][2]="2.memory"; qpa[0][3]="3.keyboard";qpa[0][4]="mouse"; qpa[1][0]="what is the basis unit of information in computing ?"; qpa[1][1]="1.byte."; qpa[1][2]="2.bit."; qpa[1][3]="3.kilobyte."; qpa[1][4]="4.mega byte."; qpa[2][0]="which part of a computer stores data temporarily?"; qpa[2][1]="1.hard drive"; qpa[2][2]="2.ram"; qpa[2][3]="3.cpu"; qpa[2][4]="4.monitor"; qpa[3][0]="which computer component connects of the internet ?"; qpa[3][1]="1.mouse"; qpa[3][2]="2.keyboard"; qpa[3][3]="3.modem"; qpa[3][4]=...