scanner program

Ads

 
 

Share on Google+Share on Google+

harika chinni
scanner program
1 Answer(s)      6 years and 8 months ago
Posted in : Java Beginners

a news paper boy purchase 100 papers every day.he purchases papers at Rs.1.50 and sells at Rs.2.00 at each.any unsold news papers,as scrap at a price of Rs.0.50. write a program to read the demand and evaluate his profit..using scanner

Ads
View Answers

February 2, 2011 at 3:54 PM


Hi Friend,

Try this:

import java.util.*;
class ScannerExample1
{
    public static void main(String[] args) 
    {  
        Scanner input=new Scanner(System.in);
        System.out.print("Enter demand: ");
        int demand=input.nextInt();
        double cp=100*1.50;
        double left=100-demand;
        double e1=demand*2.00;
        double e2=left*0.50;
        double sp=e1+e2;
        double profit=sp-cp;
        System.out.println(profit);
    }
}

Thanks


Ads









Related Tutorials/Questions & Answers:
scanner program
scanner program  a news paper boy purchase 100 papers every day.he...,as scrap at a price of Rs.0.50. write a program to read the demand and evaluate his profit..using scanner
Scanner
Scanner   Hi, I am facing a problem in the following code as what should be the while condition I should use in order to get the loop keep running...= "Celsius"; do { Scanner temp_ip= new Scanner(System.in
Advertisements
Scanner class
Scanner class  import java.util.*; class Dd { public static void main(String args[]) { Scanner sc=new Scanner(System.in); int... wrong init. my program does not work it shows ""cannot resolve symbol"". 
Scanner class
Scanner class  what have to do when an error occur about Scanner class.i code scanner sc=new Scanner(System.in); but it shows an error regarding this.   Use Scanner sc=new Scanner(System.in
without scanner
and class and didn't use the scanner .   Hi Friend, Whether the program will read the data through console or not? Please clarify this! Thanks
Read user input in Java using Scanner
Example of of reading user input in Java using Scanner In this section we are explaining the use of Scanner class in Java which can be used to read user input from console. Our sample program asks user to enter name and then age, user
scanner problem - Java Beginners
scanner problem  the program that enters sides of the triangle using scanner and outputs the area of triangle  Hi Friend, We... main(String []args){ Scanner scanner = new Scanner(System.in
cannot find symbol Scanner sc = new Scanner(system.in)
cannot find symbol Scanner sc = new Scanner(system.in)  In my one of the program in getting the error: cannot find symbol Scanner sc = new Scanner(system.in) How to resolve the error: cannot find symbol Scanner sc = new Scanner
scanner - Java Beginners
scanner   how to ask user to enter index in arry using scanner
scanner Class Error - Java Beginners
scanner Class Error  Hello Sir ,When i run the program of Scanner Class ,there is Error Can not Resolve Symbol-Scanner how i can solve..., Scanner class is not provided. Check your version.It should work with java 1.5
Hp scanner - Java Beginners
Hp scanner  Hi guys, i would like to access hp scanner using java programme. could you refer me some useful information to proceed
Scanner vs. BufferedReader
Scanner vs. BufferedReader  I have to decide from these two classes to read a file. File is of .txt type and its size is around 4.5 GB. There other text files also which is around 7 to 10 GB. So, which class is to be used to read
How to Read file line by line in Java program
. Now first thing a program has to do is to find the file. For this we use... in Java using Scanner Class: Besides the Buffer reader, using Scanner class.... The benefit of using Scanner class is that it has more utilities like nextInt
Version of com.metapossum>metapossum-scanner dependency
List of Version of com.metapossum>metapossum-scanner dependency
Version of com.metapossum>metapossum-scanner dependency
List of Version of com.metapossum>metapossum-scanner dependency
XII STD RECURSION WITHOUT SCANNER
for two input numbers. the code of my program is as follows and the error comes... not wish to use the scanner class Is there anything i can do to improve
Java file scanner
Java file scanner In this section, you will learn how to read a file using Scanner class. Description of code: J2SE5.0 provides some additional classes.... It also parses the primitive data. Scanner class gives a great deal of power
Maven Dependency metapossum-scanner >> 1.0
You should include the dependency code given in this page to add Maven Dependency of com.metapossum >> metapossum-scanner version1.0 in your project
Maven Dependency metapossum-scanner >> 1.0.1
You should include the dependency code given in this page to add Maven Dependency of com.metapossum >> metapossum-scanner version1.0.1 in your project
with out using scanner mul two matrices
with out using scanner mul two matrices  write a java program to multiply two matrices and print there result. note: don't use the scanner and the values is passed at run time....   import java.io.*; class
barcode scanner device usage in database application
barcode scanner device usage in database application  Am trying to design a supermarket inventory desktop database application however I can't seem to know how to use a barcode scanner device on my application can anyone put me
Version of com.agapsys>jpa-scanner-maven-plugin dependency
List of Version of com.agapsys>jpa-scanner-maven-plugin dependency
Version of com.agapsys>rcf-scanner-maven-plugin dependency
List of Version of com.agapsys>rcf-scanner-maven-plugin dependency
Version of com.agapsys>scanner-maven-plugin-lib dependency
List of Version of com.agapsys>scanner-maven-plugin-lib dependency
program
program  any program of hotel or school management
program
program  program of jdbc using ms access for creating table
program
program  write a javascript program to create a application form with validation
program
program  write a html program in show table and this word in box
program
program  write a program different between to dates in terms of days in java
program
program   Write a program to find the difference between sum of the squares and the square of the sums of n numbers

Ads

 
Advertisement null

Ads