important

Ads

 
 

Share on Google+Share on Google+

KUMAR GAURAV
important
1 Answer(s)      6 years and 2 months ago
Posted in : Java Beginners

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

Ads
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:
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
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
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
The ActionForm and what are important methods in ActionForm.
The ActionForm and what are important methods in ActionForm.  What is the ActionForm and what are important methods in ActionForm
Important - Java Beginners
Important Character into string vaariable  How to store the character... = prabhu.charAt(15); char q = prabhu.charAt(16); char r = prabhu.charAt(17); char... upper16 = Character.toLowerCase(q); char upper17 = Character.toLowerCase(r
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
What is the most important requirement for OLTP ?
What is the most important requirement for OLTP ?   What is the most important requirement for OLTP ?   Hi, In the transaction server..., supermarkets, and manufacturers. The most important point about oltp
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
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
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
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
Important Interview Questions in Core Java
Important Interview Questions in Core Java Core Java refers... important feature of Java? Ans: Yes, It is a platform independent language, able... and can't be forced. Garbage collection is one of the most important features of Java
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
Why SEO,Why SEO is Important,Importance of Search Engine Optimization
) is very important in increasing website traffic. This also tells you why Search Engine Optimization, Search Engine Submission and Website Promotion is important. Why SEO is important These days web masters always looks for huge traffic
5 Important Things to know About LTO 6
. Let us introduce some of the most important things to know about LTO 6. What are the important features offered by LTO 6? The high performance output... between LTO 5 and LTO 6? One of the most important things to know about LTO 6

Ads

 
Advertisement null

Ads