Posts

Showing posts from June, 2024

Program1

Image
 public class BookPriceCalculator {     public static void main(String[] args) {         String productName = "Book";         int quantity = 5;         double taxRate = 0.1; // Assuming tax rate is 10%         double originalPrice = 20.0; // Assuming original price of each book is $20         // Calculate tax amount         double taxAmount = originalPrice * taxRate;         // Calculate total price including tax         double totalPrice = (originalPrice + taxAmount) * quantity;         // Print out the details         System.out.println("Product name: " + productName);         System.out.println("Quantity: " + quantity);         System.out.println("Original Price per book: $" + originalPrice);         System.out.pr...