Posts

Que.program

Image
 import java.lang.*; import java.io.*; class Questions{ public String [][]qpa;  public String[][]qca;  Questions()throws IOException { qpa=new String[10][5]; DataInputStream in=new DataInputStream(System.in); qpa[0][0]="How to run Javaprogram on the command prompt?";  qpa[0][1]="1.javac JavaProgram"; qpa[0][2]="2.java JavaProgram";  qpa[0][3]="3.javac JavaProgram.java"; qpa[0][4]="4.No one"; qpa[1][0]="What is the use of the println method?";  qpa[1][1]="1.It is used to print text on the screen."; qpa[1][2]="2.It is used to print text on the screen with the linebreak.";  qpa[1][3]="3.It is used to read text from keyboard."; qpa[1][4]="4.It is used to read text from a file."; qpa[2][0]="How to read a character from the keyboard?";  qpa[2][1]="1.char c=System.read()"; qpa[2][2]="2.charc=System.in.read()"; qpa[2][3]="3.charc=(char)System.read()"; qpa[...

File operation

Image
 import java.io.File; import java.io.FileWriter; import java.io.FileReader; import java.io.BufferedReader; import java.io.IOException; public class FileOperations {     public static void main(String[] args) {         String filePath = "example.txt";         // Create a file         createFile(filePath);         // Write to the file         writeFile(filePath, "Hello, this is a test file.");         // Read from the file         readFile(filePath);         // Delete the file         deleteFile(filePath);     }     // Method to create a file     public static void createFile(String filePath) {         try {             File file = new File(filePath);             if (file.createNewFile()) ...

Self-introduction

 Prabha    https://prabhakalai917.blogspot.com/2024/08/selfintro-by-prabha.html Nikkirtha    https://docs.google.com/document/d/1QISw1F3Zoqlz7VQ_oGt2bfS79pJdwoui/edit?usp=drivesdk&ouid=100188991203232940672&rtpof=true&sd=true Pooja    https://docs.google.com/document/d/1QKEQZm8QsMuqLTvQ5MxVgR9m_Uo5AI5A/edit?usp=drivesdk&ouid=100188991203232940672&rtpof=true&sd=true Mahalakshmi     https://drive.google.com/file/d/1QLTtod45lFprMKwLUdD_WE_iMjA9rIqV/view?usp=drivesdk Indhuja     https://docs.google.com/document/d/1QJVtOJlCLIB4dJsPwUn9EZfcFbbbSmj3/edit?usp=drivesdk&ouid=100188991203232940672&rtpof=true&sd=true Gokila Kiruba    https://docs.google.com/presentation/d/1QByl2G52YrAp45NiJ5_eEINDrBcAFtl4/edit?usp=drivesdk&ouid=100188991203232940672&rtpof=true&sd=true Vishnupriya  https://www.blogger.com/blog/post/edit/8159846211160227854/5819521104040738630 Divagar  ...

Html & Aptitude

Image
 

A.Anbumani, P23CS369

Image
 import java.io.*; import java.nio.file.*; import java.util.List; import java.util.stream.Collectors; public class AFO{     // Read file content     public static void readFile(String filePath) throws IOException {         List<String> lines = Files.readAllLines(Paths.get(filePath));         for (String line : lines) {             System.out.println(line);         }     }     // Write content to a file     public static void writeFile(String filePath, String content) throws IOException {         Files.write(Paths.get(filePath), content.getBytes(), StandardOpenOption.CREATE, StandardOpenOption.APPEND);     }     // Copy a file     public static void copyFile(String sourcePath, String destinationPath) throws IOException {         Files.copy(Paths.get(sourcePath), Paths.ge...

Product calculation

Image
import java.util.InputMismatchException; import java.util.Scanner; public class ProductCalculation {     public static void main(String[] args) {         Scanner scanner = new Scanner(System.in);                  try {             // Input product details             System.out.print("P. Name: ");             String productName = scanner.nextLine();                          System.out.print("Quantity: ");             int quantity = scanner.nextInt();                          System.out.print("Price: ");             double price = scanner.nextDouble();                        ...