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



Home Answers Viewqa Java-Beginners simple team leader
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


ashaanniegeorge
simple team leader
3 Answer(s)      3 years and a month ago
Posted in : Java Beginners


Could you please help me to write a program for a simple team leader?


Advertisement
View Answers

November 28, 2011 at 4:38 PM


Please clarify your problem. Which type of program you want to create in java? Please specify this.



November 29, 2011 at 12:35 AM


A company has a file with records of employees name and team number. Each team has 5 members. The 3rd member of each team is the team leader. Write a program to read the records from this file and display the names of the teamleaders on the screen



November 29, 2011 at 4:59 PM


We have took 2 teams with 5 members each. Depend of which we have created the following code:

import java.io.*;
import java.util.*;

public class TeamLeader{
    public static void main(String []args) throws Exception{
    FileInputStream fstream = new FileInputStream("leader.txt");
    DataInputStream in = new DataInputStream(fstream);
    BufferedReader br = new BufferedReader(new InputStreamReader(in));
    String strLine;
    ArrayList list=new ArrayList();
    while((strLine = br.readLine()) != null){
    list.add(strLine);
    }
    String team1[]=new String[5];
    String team2[]=new String[5];
    Iterator itr;
    int k=0,p=0;
    for (itr=list.iterator(); itr.hasNext(); ){
    String str=itr.next().toString();  
    String [] splitSt =str.split(" ");
    String name="",num="";
      for (int i = 0 ; i < splitSt.length ; i++) {
      name=splitSt[0];
      num=splitSt[1];
          }
          if(Integer.parseInt(num)==1){
          team1[k]=name;
          k++;
          }
          if(Integer.parseInt(num)==2){
          team2[p]=name;
          p++;
          }
    }
    System.out.println("Team Leader of Team 1: "+team1[2]);
    System.out.println("Team Leader of Team 2: "+team2[2]);

    }
}


Related Tutorials/Questions & Answers:
simple team leader
simple team leader  Could you please help me to write a program for a simple team leader?   Please clarify your problem. Which type of program you want to create in java? Please specify
Eclipse Plunging/Team Development
Eclipse Plunging/Team Development  ... utilized the many advanced capabilities provided through the "Team...; Insectivore: Team Task Sharing Insectivore: Team Task Sharinghttp
Advertisements
simple program
simple program  how to print * like triangle
simple pgm
simple pgm  a java program which uses super class
simple query
simple query  Write a stored procedure to retrieve a column which are less then or equal to that column using if statement
simple examples
simple examples  hi,we want to print a comma between two words we put comma in double quotes .Is it correct
simple eg
simple eg   <?php</li> $string = ?Hello Users?; print (?Welcome to Roseindia, I want to greet $string?); print (??); $string = ?Bye Bye!?; print (?OK meet you soon, $string?); ?> in this program we get a error at line
What it Takes to be a Leader
What it Takes to be a Leader     ... powerful word- leadership. Being a leader is not to be confused with being the boss. You can have a boss who fails as a leader. Similarly, you might have several
A Simple program
A Simple program  Hi I have written the following code: class FirstRectangle{ public int rectArea(int l,int b){ int farea = l*b; System.out.println("Required Area::"+farea); return farea
simple class in php
simple class in php  example of simple class in PHP
Simple FTP upload in Java
Simple FTP upload in Java  How to write a program for Simple FTP upload in Java? Any code example of Simple FTP upload in Java will be very helpful for me. Thanks
simple calculator program in javascript
simple calculator program in javascript  strong textsimple calculator in javascript
Simple Java Projects
Simple Java Projects  Hi, I am beginner in Java and trying to find Simple Java Projects to learn the different concepts on Java. Can anyone tell me where to get it? Thanks
Simple JSP program
Simple JSP program  create a simple jsp page in which number is to be entered by user in jsp page and submit button clicked.If number entered is greater then 100,then message box "no is greater" elseif less "no is lesser
Simple Login(JSF)
Simple Login(JSF)  I have tried to run the Simple Login code provided using netbeans. It gives me error. CAn I run it using netbeans or need to config anything in order to run the prog
simple calculator - Java Beginners
simple calculator  how can i create a simple calculator using java codes?  Hi Friend, Please visit the following link: http://www.roseindia.net/java/example/java/swing/calculator-in-swing.shtml Thanks
simple webdesign program with coding
simple webdesign program with coding  how to design a webpage using html   Please go through the following link: HTML Tutorials
simple program question
simple program question  how do i get a java program to take an input from the user and have it terminate by a period and not by pressing enter
Simple Example of Hibernate 4
Simple Example of Hibernate 4  Hi, As a new comer in the Hibernate programming, I want simple program of Hibernate to learn the basic concepts... Simple Example More Tutorials for a beginner: Hibernate Tutorials Home page
Simple application using hibernate
Simple application using hibernate  Hi, How to write a simple application using hibernate in Eclipse IDE? I would like to to learn: Process... of the tutorial you will like to learn for creating the simple application using
Simple java applet
Simple java applet  Create a Java applet to display your address on the screen. Use different colors for background and text   Please visit the following link: Applet Examples
create a simple form
create a simple form  Helo. i am learning php, and i need help creating below for. Its simple but i need help. Create a form that contains: 1. Name, textbox 2. Submit button If the user inputs the Name textbox and clicks
Run a simple EJB code
Run a simple EJB code  I found the code this. However, as I have no idea with EJB, I can't understand how to run it. Can anybody help me by giving... is acceptable). Thanks.   Please visit the following link: Simple EJB
Run a simple EJB code
Run a simple EJB code  I found the code this. However, as I have no idea with EJB, I can't understand how to run it. Can anybody help me by giving... is acceptable). Thanks.   Please visit the following link: Simple EJB
developing simple web service
/ About Axis: Apache Axis is an implementation of the Simple Object...: The Web Services Invocation Framework (WSIF) is a simple Java API
to find simple interst
to find simple interst  create a class of object insert with a constructor. write a program to find out simple interest   import java.util.... si=p*rate*t; System.out.println("Simple Interest: "+si); } public
simple java search engine
simple java search engine  i have already downloaded the project simple java search engine.but i am not able to run it.can anyone help me.i have.... ABSTRACT Title : Simple Search Engine System Specification: The system on which
simple javascript validation for numbers
simple javascript validation for numbers  simple javascript validation for register number   Here is a html code that accepts number from the user and check whether the entered value is valid. <html> <head>
Simple EJB3.0 - EJB
Simple EJB3.0  Hi friends... I am new user for this roseindia.net.. i am new for EJB3.0 also.. >>> my question is how to make session bean and how to access this session
Simple clarification - JSP-Servlet
Simple clarification  Respected Sir/Madam, Thanks for your immediate response..Sorry for troubling you again and again. So,you told that there is no possibility for getting my alert box in home page. Is there any other
Create a Simple Procedure
Create a Simple Procedure       Simple Procedure is a set of SQL statement which are executed... how to create a simple procedure. This procedure display all records of stu
Advertisements
 

 

 

DMCA.com