important

Ads
 

important

programming in java to find the number of different notes and coins in given amount by user

View Answers

September 20, 2011 at 1:14 PM

import java.util.*;
class NotesAndCoins 
{
    public static void main(String[] args) 
    {
        Scanner input=new Scanner(System.in);
        System.out.print("System.out.print: ");
        int amount=input.nextInt();
        int thousand, five_hundred, hundred, fifty, ten, five,two,one;
        System.out.println(" DISTRIBUTION OF MONEY "+amount+" rupees ");
        thousand=amount/1000;
        amount=amount - (thousand*1000);

         five_hundred=amount/ 500;
         amount=amount - (five_hundred*500);

         hundred=amount/100;
         amount=amount - (hundred*100);

         fifty=amount/50;
         amount=amount - (fifty*50);

         ten=amount/10;
         amount=amount - (ten*10);

         five=amount/5;
         amount=amount - (five*5);

         two=amount/2;
         amount=amount - (two*2);

         one=amount/1;
         amount=amount - (one*1);


         System.out.println(" Thousand Rupee Note      =    "+thousand);
         System.out.println(" Five Hundred Rupee Note  =    "+five_hundred);
         System.out.println(" Hundred Rupee Note       =    "+hundred);
         System.out.println(" Fifty Rupee Note         =    "+fifty);
         System.out.println(" Ten Rupee Note           =    "+ten);
         System.out.println(" Five Rupee Note          =    "+five);
         System.out.println(" Two Rupee Coin           =    "+two);
         System.out.println(" One Rupee Coin           =    "+one);



        }
    }

Ads









Related Tutorials/Questions & Answers:
important
important
Advertisements
Important Question
Important Question  Respected Sir, I am Sanjay Baniwal working in BHEL as a Software Developer as a trainee for One Year. And i have been given a Project in which i have to create a JSP page with a Drop Down List in which all
ModuleNotFoundError: No module named 'important'
ModuleNotFoundError: No module named 'important'  Hi, My Python... 'important' How to remove the ModuleNotFoundError: No module named 'important' error? Thanks   Hi, In your python environment you
Important things in the Cloud Computing
Important things in the Cloud Computing  Hi, What are the Important things in the Cloud Computing? Thanks   Hi, Here is the list of important things in the Cloud Computing or the important skills necessary for Cloud
important for all beginers
important for all beginers  what is the difference for top down approach and bottom up approach with a example program of source code with clear explanation
Is Python important for finance?
Is Python important for finance?  Hi, I am beginner in Data Science...: Is Python important for finance? Try to provide me good examples or tutorials links so that I can learn the topic "Is Python important for finance?"
Is math important for data science?
Is math important for data science?  Hi, I am beginner in Data...: Is math important for data science? Try to provide me good examples or tutorials links so that I can learn the topic "Is math important for data science
important skills for data scientists
important skills for data scientists  Hi, I am beginner in Data...: important skills for data scientists Try to provide me good examples or tutorials links so that I can learn the topic "important skills for data
Why application server is important?
Why application server is important?  Hi, I have to select the good application server for running my Java based web applications. Which application server or tomcat container is good to run the application. On my website
very important - Kindly help
very important - Kindly help   I am creating web page for form registration to my department ..I have to Reprint the Application Form (i.e Download the PDf File from the Database ) , when the user gives the Application number
Important Java Interview Question
Important Java Interview Question  Complete the Solver constructor so that a call to solveAll return a list with 2 values including the square root and the inverse of the integer passed as parameter. public interface
ModuleNotFoundError: No module named 'important-words'
ModuleNotFoundError: No module named 'important-words'  Hi, My... named 'important-words' How to remove the ModuleNotFoundError: No module named 'important-words' error? Thanks   Hi, In your python
important topics to prepare for java interview
important topics to prepare for java interview  hi friends can anyone tell what are the important topics to prepare for java interview????   Each and every topic is important for an interview. You can find some
AsyncContext Interface important methods
In this section , you will get to know about important methods of AsyncContext Interface
AsyncListener Interface important methods
In this section, you will get to know about important methods AsyncListener Interface
Class AsyncEvent important methods
In this section, you will learn about the important methods of AsyncEvent Class
What is most important features of Java
What is most important features of Java  Hi, What is the most important features of Java? Thanks   Hi, The latest version of Java 7 having some most important features like Java virtual Machine, Language updates
JPQL helpppppp please very important
JPQL helpppppp please very important   there are 3 tables: book: isbn title loan: isbn borrowerId borrower: borrowerId FirstName LastName I want to write a JPQL Query that show only the Available books and not loaned
Outsourcing: The Most Important Questions - RoseIndia
Outsourcing: The Most Important Questions Introduction Outsourcing work is an important business decision that can make or mar your prospects... of the important components that help you to take the right decisions
important for all final years student
important for all final years student   i need a java program for my project, java program for getting path of the file in console while reading a file it should add page number in all pages after that delete all common letters
important for all final years student
important for all final years student  i need a java program for my project, java program for getting path of the file in console while reading a file it should add page number in all pages after that delete all common words
important for all final years student
important for all final years student  i need a java program for my project, java program for getting path of the file in console while reading a file it should add page number in all pages after that delete all common words
Searching For Important Issues for Writing Articles
Searching For Important Issues for Writing Articles  ... important issues depends on the following things: About what industry do you... naturally have a flair for writing about important issues and attaining major
Interview Questions - What are important features of Java?
Interview Questions - What are important features of Java?  Hi, What are important features of Java? Thanks   Hi, Being a popular Object Oriented programming language, Java comes with its most important feature. Its
How important is Java Spring Framework currently
How important is Java Spring Framework currently  Hi, Actually I want to know the importance of Spring Framework and todays context. How important... Framework is still very important as it provide many technologies for making
Interview Questions - What are important Java Language Elements?
Interview Questions - What are important Java Language Elements?  Hi, What are important Java Language Elements? Thanks   Hi, Java is vast programming language with many api which comes with the default distribution
Why Big Data is important for Enterprises?
is very important in managing the huge set of structured and un-structured... daily. So, its very important for the enterprises for gathering and analyzing.... These information are very important in deciding the business plans. There days Big Data
Interview Questions - What are important Java Editions or Parts of Java?
Interview Questions - What are important Java Editions or Parts of Java?  Hi, What are important Java Editions or Parts of Java? How many components of Java Platform? Thanks   Hi, Java is platform independent object
Most Important Areas of SEO Strategy
In presenting here the most important areas of SEO strategy we must note... and consequently dominate search ranks. Let us introduce ourselves to most important areas of SEO strategy. Relevant Content There is no area as important as content
inheritance....please help me friends...!!!... this is important project that i have to do it..
inheritance....please help me friends...!!!... this is important project that i have to do it..   Point ................. #x : int #y : int + Point() + Point(xCoordinate:int, YCoordinate:int) + getX() : int + getY() : int

Ads