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
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
Math,
6 months ago
Geography,
6 months ago
Computer Science,
1 year ago
Math,
1 year ago
Math,
1 year ago