Computer Science, asked by kuhusingh2000, 10 months ago

Write a program that reads the cost of an item in the form rrrr.Pp (where rrrr denotes rupees and pp denotes paise)refer sample input and output.

Answers

Answered by sswaraj04
1

Answer:

Explanation:

import java.util.Scanner;

public class GetInputFromUser

{

  public static void main(String args[])

  {

     float b;

   

     Scanner in = new Scanner(System.in);

   

     System.out.println("Enter cost of item");

     b = in.nextFloat();

     int c=(int)b;

     b=b-c;

     System.out.println("cost of item is "+c+" rupees "+b+" paise");

  }}

Similar questions