Computer Science, asked by jawaidsaman20701, 9 months ago

Write a programme to input price and quantity of a product.Calculate the total cost,10%flat discount on the total cost and the net amount to be paid.Print the output including all input and resultant data.

Answers

Answered by prashantrohilla32
26

Answer:

import java.util.Scanner;

public class Main

{

public static void main(String[] args) {

    Scanner sc=new Scanner(System.in);

     System.out.println("Enter price : ");

        int price=sc.nextInt();

         System.out.println("Enter quantity: ");

        int quantity=sc.nextInt();

        int total_cost=quantity*price;

        int discount= (total_cost/100)*10;

        int net_amount=total_cost-discount;

   

    System.out.println("Price of one Item= "+price);

    System.out.println("Price of "+quantity+" Items= "+total_cost);

    System.out.println("10% discont on "+total_cost+" = "+discount);

    System.out.println("Net amount to be paid= "+total_cost+" - "+discount+" = "+net_amount);

}

}

Explanation:

It is a java program.

Attachments:
Answered by tanishkakhandelwal9e
12

Answer:

Here is your answer. Hope it helps.......Thank you so much

Attachments:
Similar questions