Posts

Showing posts from June, 2024

ALL STUDENT PRODUCT CALCULATION

  FIRE 1 June 25, 2024 ALL STUDENT PRODUCT CALCULATION P 23 CS 366 Akash   :    Akash P 23 CS 367 Ammu P 23 CS 368 P 23 CS 369 Anbumani P 23 CS 370 Aravinth Aravind P 23 CS 371 BARATH .M Barath P 23 CS 372 Divagar Divagar P 23 CS 373kiruba Kiruba P 23 CS 374 G.Hepsiba Hepsiba P 23 CS 375 Indhuja P 23 CS 376 Ishwarya P 23 CS 377 Jeevitha P 23 CS 378 Kalaimani P 23 CS 379 karunadithiyan .M karunadithiyan P 23 CS 380:keerthikalakshmi: https://keerthikasekar.blogspot.com/2024/06/program-1.html P 23 CS 381M. Keerthika Keerthika P 23 CS 382 Mahalakshmi P 23 CS 383mani https://nkmanikandan.blogspot.com/2024/06/blog-post.html P 23 CS 384 P 23 CS 385 P 23 CS 386 Mathavan P 23 CS 387 Nikitha P 23 CS 388:nivedha https://nivedhakannan08.blogspot.com/2024/06/program-1.html P 23 CS 389 G. Nivetha P 23 CS 390 Pooja P 23 CS 391 https://prabhakalai917.blogspot.com/2024/06/product-excluding-and-product-including.html P 23 CS 392:pragathesh...

Product Calculation Using Java

Image
 // Define the Product class class Product {     private String name;     private double price;     private int quantity;     private double taxRate; // Tax rate as a decimal (e.g., 0.08 for 8%)     // Constructor to initialize the product     public Product(String name, double price, int quantity, double taxRate) {         this.name = name;         this.price = price;         this.quantity = quantity;         this.taxRate = taxRate;     }     // Method to calculate the total cost including tax     public double calculateTotalCost() {         double subtotal = price * quantity;         double taxAmount = subtotal * taxRate;         double totalCost = subtotal + taxAmount;         return totalCost;     }     // Getter...