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...

BIO DATA

 Name: R. Ramya      Class: ll M.Sc Computer Science    Reg No: P 23 CS 394  College Name: GACA (KUM)  DOB: 14/03/2003 Qualification: Bsc, Computer Science   Father's Name: S. Ravi  Occupation: Farmer Mother's Name: R. Gomathi  Occupation: House Wife  Annual Income: 60,000  Blood Group: B+ve  Mobile Number: 6379509851 E-mail Id : ramyaravi583@gmail.com    

Java program

 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]="...

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;     }     // ...