Posts

File operations

 import java.io.File; import java.io.FileWriter; import java.io.IOException; import java.nio.file.Files; import java.nio.file.Paths; import java.util.Scanner; public class FileOperations {          public static void main(String[] args) {         Scanner scanner = new Scanner(System.in);         int choice;                  do {             System.out.println("\nFile Operations Menu:");             System.out.println("1. Create a File");             System.out.println("2. Update a File");             System.out.println("3. Delete a File");             System.out.println("4. Exit");             System.out.print("Enter your choice: ");             choice = scanner.nextI...

Java. One

  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]="keyboard?"; qpa[0][1]="1.input"; 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 ofthe println method?"; qpa[1][1]="1.Itisusedtoprinttextonthescreen."; qpa[1][2]="2.Itisusedtoprinttextonthescreenwiththelinebreak."; qpa[1][3]="3.Itisusedtoreadtextfromkeyboard."; qpa[1][4]="4.Itisusedtoread textfromafile."; qpa[2][0]="Howtoreadacharacterfromthekeyboard?"; qpa[2][1]="1.char c=System.read()"; qpa[2][2]="2.char c=System.in.read()"; qpa[2][3]="3.char c=(char)System.read()"; qpa[2][4]="4.char c=(char)System.in.read()"; qpa[3][0]=...

Bio Data

  Name : D. Sobiya Class: II M. Sc Computer Science  RegNo: P 23 Cs 396 College Name: GACAKUM (A) Father Name : P. Duraisamy  occupation : Farmer Mother Name : D. Sagunthala  Occupation : House Wife  Annual Income : 60,000 Blood group : "o+ve DOB : 31/03/2003 Email Id :sobiyasobiya819@gmail.com  Phone No : 7871212831 Address Details: 353,pillumangudi, kamachipuram (po) thiruvidaimarudur (tk) thanjavur (Dt) pincode :609 807 Qualification details: B.sc (computer Science) Skills : Typewritting,tamil, English (higher ) Hobbies : cooking  AIM : Government Job (or) IT field 

P23cs396

Product calculation

 import java.text.DecimalFormat; // Product excluding tax class class ProductExcludingTax {     private String productName;     private int quantity;     private double price;     private double taxRate; // Tax rate as a decimal (e.g., 0.1 for 10% tax)     // Constructor     public ProductExcludingTax(String productName, int quantity, double price, double taxRate) {         this.productName = productName;         this.quantity = quantity;         this.price = price;         this.taxRate = taxRate;     }     // Calculate total amount including tax     public double calculateTotalAmount() {         double totalAmount = quantity * price;         double taxAmount = totalAmount * taxRate;         return totalAmount + taxAmount;     }     // ...