Computer Science, asked by Nutanc6859, 9 months ago

Input price of a pen and number of pens purchased calculate and print amount to be paid

Answers

Answered by mn121
2

As you have not mentioned in which language the program should be written, so I am writing the program using java...

**************************************************************************************

import java.util.*;

public class pen_amount

{

   public static void main(String args[])

   {

       Scanner in = new Scanner(System.in);

       int n;

       double p,amt;

       System.out.println("Enter prince of a pen and number of pens purchased:");

       p=in.nextDouble();

       n= in.nextInt();

       amt=p*n;

       System.out.println("Amount to be paid: "+amt);

   }

}

***********************************************************************************

Hope it helps you...

Please mark it as brainliest...

Answered by Anonymous
4

Answer:

its a python program...

Explanation:

price=eval(input("enter the price of one pen"))

num=int(input("enter the number of pens"))

amount=price*num

print(amount,"is the total amount of",num,"of pens")

# hope it helps you

please mark brainliest

Similar questions