important

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);



        }
    }









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 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
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?"
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
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 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
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
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
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. ADS_TO_REPLACE_1 The most important point
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: ADS_TO_REPLACE_1 About what... knowledge, you would naturally have a flair for writing about important issues
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
Important Interview Questions in Core Java
Important Interview Questions in Core Java Core Java refers... is the most important feature of Java?ADS_TO_REPLACE_2 Ans: Yes, It is a platform... process and can't be forced. Garbage collection is one of the most important
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... very important to optimize your website for certain targeted key words
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
Answer me ASAP, Thanks, very important
Why web designing is important
Why web designing is important In the era of digital revolution websites plays vital role in enhancing business by connecting new customer from the world. The websites has become important resource and attached in many aspects
Important JDBC Concepts
Important JDBC Concepts       Transactions: Whenever a connection is created by using the JDBC, then by default it is in auto- commit mode
Java Glossary Term - M - Java Important Terms - Java Programming Glossary
What is Data Science and why it is important?
Data Science: What is Data Science and why it is important? In this section we... requirement in business. We will also see how Data Science is important... Scientists job is very important for the business and it add value
Other Important Travel Sites of Agra
Other Important Travel sites in Agra From Mughal monuments to ancient temples, missionary churches to the modern day multiplexes, Agra has emerged into a blend of history and modernity. Although Agra is famous particularly
Shopping Cart Development An Important Tool In The Running Of Any Business
Shopping Cart Development – An Important Tool In The Running Of Any Business Ecommerce is growing in leaps and bounds and new businesses are bursting onto the scene. With this amount of competition you have to make sure
Hibernate API
Hibernate API In this section we will learn about important Hibernate API. Hibernate one of the best ORM tool to develop database driven applications... on the persistent objects or the entity classes. The important classes and interfaces
Flex Howto
Flex Howto       In this section, you will find miscellaneous articles in flex and will be introduced with several important topics and issues that are commonly used while developing
JSF Application
JSF Application           Immediate Event Handling Example Event Handling is one of the important concepts in JSF. This section provides a simple JSF
Java - Array in Java
Array Example - Array in Java       Array: Array is the most important thing in any programming language. By definition, array is the static memory allocation. It allocates
php Operators
php Operators:       Operators are one of the important feature of every language. In php operators are classified in following categories:ADS_TO_REPLACE_1 ArithmeticOperator Comparison
Java EE 6 Tutorial
In this section, you will get the details about the newly added important features in Java EE6

Ads