without scanner

without scanner

a company need a system to store the data about the employees , the number of employees is dynamic , you need to store the following attributes : name , age , salary and note that we need to solve it using array and class

and didn't use the scanner .

View Answers

December 7, 2010 at 3:41 PM

Hi Friend,

Whether the program will read the data through console or not?

Please clarify this!

Thanks


December 8, 2010 at 2:05 AM

it works but i need it without scanner


December 8, 2010 at 4:20 PM

Hi Friend,

Try the following code:

import java.io.*;

public class EmployeeData{
public static void main(String[] args) throws Exception{
    String name[]=new String[2];
    String age[]=new String[2];
    String salary[]=new String[2];
    String note[]=new String[2];
    InputStreamReader isr = new InputStreamReader(System.in);
    BufferedReader br = new BufferedReader(isr);

    for(int i=0;i<2;i++){
        System.out.println();
        System.out.println("Employe "+(i+1));
        System.out.print("Enter Name:  ");
        name[i]=br.readLine();
        System.out.print("Enter Age:  ");
        age[i]=br.readLine();
        System.out.print("Enter Salary:  ");
        salary[i]=br.readLine();
        System.out.print("Enter Note:  ");
        note[i]=br.readLine();
    }
    FileWriter fw=new FileWriter(new File("employee.txt"),true);
    BufferedWriter bw=new BufferedWriter(fw);
    for(int i=0;i<2;i++){
        bw.write(name[i]+" "+age[i]+" "+salary[i]+" "+note[i]);
        bw.newLine();
    }
    bw.close();
}
}

Thanks









Related Tutorials/Questions & Answers:
without scanner
without scanner  a company need a system to store the data about the employees , the number of employees is dynamic , you need to store the following... and class and didn't use the scanner .   Hi Friend,ADS_TO_REPLACE_1
XII STD RECURSION WITHOUT SCANNER
XII STD RECURSION WITHOUT SCANNER  the recursive function gives a stack overflow error. I want to calculate the GDC ie the greatest Integer function... not wish to use the scanner class Is there anything i can do to improve
Advertisements
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
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
without ;
without ;  can u give me an example of a program without
without ;
without ;  can u give me an example of a program without
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
Scanner class
Scanner class  import java.util.*; class Dd { public static void main(String args[]) { Scanner sc=new Scanner(System.in); int... Scanner class was introduced in java 5
scanner program
scanner program  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... his profit..using scanner
Scanner
Iteration without loop
Iteration without loop  Hi, Is there any way I can have a line of code iterate a number of times set by the user without having a while loop or any...[] args) { Scanner input=new Scanner(System.in
scanner - Java Beginners
scanner   how to ask user to enter index in arry using scanner
ModuleNotFoundError: No module named 'scanner'
ModuleNotFoundError: No module named 'scanner'  Hi, My Python... 'scanner' How to remove the ModuleNotFoundError: No module named 'scanner... to install padas library. You can install scanner python with following command
ModuleNotFoundError: No module named 'scanner'
ModuleNotFoundError: No module named 'scanner'  Hi, My Python... 'scanner' How to remove the ModuleNotFoundError: No module named 'scanner... to install padas library. You can install scanner python with following command
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
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
Action without a form.
Action without a form.  Can I have an Action without a form
Breaking a string into words without using StringTokenizer
Breaking a string into words without using StringTokenizer  how can we Break a string into words without using StringTokenizer ??   ... { public static void main(String[] args) { Scanner input=new
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 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
ModuleNotFoundError: No module named 'collection-scanner'
ModuleNotFoundError: No module named 'collection-scanner'  Hi, My... named 'collection-scanner' How to remove the ModuleNotFoundError: No module named 'collection-scanner' error? Thanks   Hi, In your
ModuleNotFoundError: No module named 'jshint-scanner'
ModuleNotFoundError: No module named 'jshint-scanner'  Hi, My... named 'jshint-scanner' How to remove the ModuleNotFoundError: No module named 'jshint-scanner' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'netbox-scanner'
ModuleNotFoundError: No module named 'netbox-scanner'  Hi, My... named 'netbox-scanner' How to remove the ModuleNotFoundError: No module named 'netbox-scanner' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'robots-scanner'
ModuleNotFoundError: No module named 'robots-scanner'  Hi, My... named 'robots-scanner' How to remove the ModuleNotFoundError: No module named 'robots-scanner' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'ssid-scanner'
ModuleNotFoundError: No module named 'ssid-scanner'  Hi, My Python... 'ssid-scanner' How to remove the ModuleNotFoundError: No module named 'ssid-scanner' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'tarfile_scanner'
ModuleNotFoundError: No module named 'tarfile_scanner'  Hi, My... named 'tarfile_scanner' How to remove the ModuleNotFoundError: No module named 'tarfile_scanner' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'waveplot-scanner'
ModuleNotFoundError: No module named 'waveplot-scanner'  Hi, My... named 'waveplot-scanner' How to remove the ModuleNotFoundError: No module named 'waveplot-scanner' error? Thanks   Hi, In your
ModuleNotFoundError: No module named 'zebra-scanner'
ModuleNotFoundError: No module named 'zebra-scanner'  Hi, My... 'zebra-scanner' How to remove the ModuleNotFoundError: No module named 'zebra-scanner' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'barcode-scanner'
ModuleNotFoundError: No module named 'barcode-scanner'  Hi, My... named 'barcode-scanner' How to remove the ModuleNotFoundError: No module named 'barcode-scanner' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'gram-scanner'
ModuleNotFoundError: No module named 'gram-scanner'  Hi, My Python... 'gram-scanner' How to remove the ModuleNotFoundError: No module named 'gram-scanner' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'collection-scanner'
ModuleNotFoundError: No module named 'collection-scanner'  Hi, My... named 'collection-scanner' How to remove the ModuleNotFoundError: No module named 'collection-scanner' error? Thanks   Hi, In your
ModuleNotFoundError: No module named 'collection-scanner'
ModuleNotFoundError: No module named 'collection-scanner'  Hi, My... named 'collection-scanner' How to remove the ModuleNotFoundError: No module named 'collection-scanner' error? Thanks   Hi, In your
ModuleNotFoundError: No module named 'gram-scanner'
ModuleNotFoundError: No module named 'gram-scanner'  Hi, My Python... 'gram-scanner' How to remove the ModuleNotFoundError: No module named 'gram-scanner' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'port-scanner'
ModuleNotFoundError: No module named 'port-scanner'  Hi, My Python... 'port-scanner' How to remove the ModuleNotFoundError: No module named 'port-scanner' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'raccoon-scanner'
ModuleNotFoundError: No module named 'raccoon-scanner'  Hi, My... named 'raccoon-scanner' How to remove the ModuleNotFoundError: No module named 'raccoon-scanner' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'rtlsdr_scanner'
ModuleNotFoundError: No module named 'rtlsdr_scanner'  Hi, My... named 'rtlsdr_scanner' How to remove the ModuleNotFoundError: No module named 'rtlsdr_scanner' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'ssh_scanner'
ModuleNotFoundError: No module named 'ssh_scanner'  Hi, My Python... 'ssh_scanner' How to remove the ModuleNotFoundError: No module named 'ssh_scanner' error? Thanks   Hi, In your python environment
ModuleNotFoundError: No module named 'ssl-scanner'
ModuleNotFoundError: No module named 'ssl-scanner'  Hi, My Python... 'ssl-scanner' How to remove the ModuleNotFoundError: No module named 'ssl-scanner' error? Thanks   Hi, In your python environment
ModuleNotFoundError: No module named 'string-scanner'
ModuleNotFoundError: No module named 'string-scanner'  Hi, My... named 'string-scanner' How to remove the ModuleNotFoundError: No module named 'string-scanner' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'tarfile_scanner'
ModuleNotFoundError: No module named 'tarfile_scanner'  Hi, My... named 'tarfile_scanner' How to remove the ModuleNotFoundError: No module named 'tarfile_scanner' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'virtual-scanner'
ModuleNotFoundError: No module named 'virtual-scanner'  Hi, My... named 'virtual-scanner' How to remove the ModuleNotFoundError: No module named 'virtual-scanner' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'yara-scanner'
ModuleNotFoundError: No module named 'yara-scanner'  Hi, My Python... 'yara-scanner' How to remove the ModuleNotFoundError: No module named 'yara-scanner' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'cloud-scanner'
ModuleNotFoundError: No module named 'cloud-scanner'  Hi, My... 'cloud-scanner' How to remove the ModuleNotFoundError: No module named 'cloud-scanner' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'collection-scanner'
ModuleNotFoundError: No module named 'collection-scanner'  Hi, My... named 'collection-scanner' How to remove the ModuleNotFoundError: No module named 'collection-scanner' error? Thanks   Hi, In your
ModuleNotFoundError: No module named 'jshint-scanner'
ModuleNotFoundError: No module named 'jshint-scanner'  Hi, My... named 'jshint-scanner' How to remove the ModuleNotFoundError: No module named 'jshint-scanner' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'kafka-scanner'
ModuleNotFoundError: No module named 'kafka-scanner'  Hi, My... 'kafka-scanner' How to remove the ModuleNotFoundError: No module named 'kafka-scanner' error? Thanks   Hi, In your python
how to reverse a string without changing its place
how to reverse a string without changing its place  how to reverse a string without changing its place   Hi Friend, Another way... void main(String[]args){ Scanner input=new Scanner(System.in
Double To Int Without TypeCasting
Double To Int Without TypeCasting  How to convert Double to Int without using typecasting?   class ConvertDoubleToInt { public static void main(String[] args) { double d=25.5; int num=new
Application without Interface Builder!!
Application without Interface Builder!!  Can we make our iphone application without Interface Builder???   hello, yes , it is possible to make an iphone application without interface builder..ADS_TO_REPLACE_1 we can
Version of com.metapossum>metapossum-scanner dependency
List of Version of com.metapossum>metapossum-scanner dependency

Ads