Write a program to input number of Rs10 coins ,Rs5 coins , Rs1 coins , 50paisa coins and 20paisa coins that you have Calculate and print their total value in rupees.
[Java program]
Answers
CODE
import java.util.*;
class Rupees
{
public void main()
{
Scanner sc=new Scanner(System.in);
System.out.println("Enter the number of Rs 10 coins");
int n10 = sc.nextInt();
System.out.println("Enter the number of Rs 5 coins");
int n5 = sc.nextInt();
System.out.println("Enter the number of Rs 1 coins");
int n1 = sc.nextInt();
System.out.println("Enter the number of 50 paisa coins");
int n05 = sc.nextInt();
System.out.println("Enter the number of 20 paisa coins");
int n02 = sc.nextInt();
double total = ( n02*0.2) + ( n05*0.5 ) + ( n1 * 1.0 ) + ( n5*5.0) + ( n10*10.0);
System.out.println("The total value in rupees is "+total);
}
}
NOTE :
↪ The printing should be done at the last .
↪ Use 1 rupees = 100 paise .
↪ Then 20 paisa will become 0.2 and 50 paisa will become 0.5 ,
↪ Multiply the respective values with the number of coins and then add .
↪ Total the amount and then print the output .
Answer:
TECHNO BLADE
Explanation:
RIP 3:3