Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa Java-Beginners scanner program
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


harika chinni
scanner program
1 Answer(s)      3 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


Advertisement
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



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
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
scanner - Java Beginners
scanner   how to ask user to enter index in arry using scanner
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 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
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
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
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
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
Pattern,Matcher,Formatter and Scanner classes
Pattern,Matcher,Formatter and Scanner classes This section Describes : 1... using the Formatter and Scanner classes and the PrintWriter.format/printf..., n) Formatted input The scanner API provides basic input
input using scanner and add/sub/mul/div of a matrix
input using scanner and add/sub/mul/div of a matrix  hiiii...... performe matrix add/sub/mul/div using scanner
Creating a File I/O using import scanner, io.* and text.*
Creating a File I/O using import scanner, io.* and text.*  open a file for reading and open another file for writing data. input file hours-int, hourly rate-double, name-string. output file name-string, hours-int, hourly rate
can we use scanner class,class , object and methods to get output without using constructor ????
can we use scanner class,class , object and methods to get output without using constructor ????  im getting error here..i hav used scanner class... am i getting error here... can we get output using scanner class , object
Local Port Scanner
Local Port Scanner       This is a simple program of java network. Here, we are going to define.... Socket classes are used to establish a connection between client program
program
program  any program of hotel or school management
program
program  write a program different between to dates in terms of days in java
program
program  write a html program in show table and this word in box
program
program  write a javascript program to create a application form with validation
program
program  program of jdbc using ms access for creating table
program
program  WAP a java program to form 1/2+3/4+5/6+7/8 series
program
program  develop a servlet to insert the data in the database from our program in the table stored in the database
program
program  write a program reversee a string. input-hi this is roseindia output-roseindia is this hi
program
program   Write a program to find the difference between sum of the squares and the square of the sums of n numbers
program
program   An old-style movie theater has a simple profit program. Each customer pays $5 per ticket. Every performance costs the theater $20, plus $.50 per attendee. Develop the program calculateTotalProfit that consumes
program
program  write a java program to input a no. and print wheather the no. is a special no or not. (special no. are those no whose factorial of the sum of digit of the no is same as the original
 

 

 

DMCA.com