Online Training Spring Hibernate Training in Delhi R Programming Training Course Big Data and Hadoop Training Java Training  
 

simple team leader

Ads

 
 

Share on Google+Share on Google+

ashaanniegeorge
simple team leader
3 Answer(s)      5 years and 8 months ago
Posted in : Java Beginners

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

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

    }
}

Ads









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
Version of com.teambytes>aws-leader-election_2.10 dependency
List of Version of com.teambytes>aws-leader-election_2.10 dependency
Advertisements
Version of com.teambytes>aws-leader-election_2.11 dependency
List of Version of com.teambytes>aws-leader-election_2.11 dependency
Like Team viewer
Like Team viewer  As i am developing one small application, In that i have one doubt if any i was working in my application(o/p) that out put has been displayed on another computer whatever i do in the myapplication
Maven Dependency aws-leader-election_2.10 >> 1.0.0
You should include the dependency code given in this page to add Maven Dependency of com.teambytes >> aws-leader-election_2.10 version1.0.0 in your project
Maven Dependency aws-leader-election_2.11 >> 1.0.0
You should include the dependency code given in this page to add Maven Dependency of com.teambytes >> aws-leader-election_2.11 version1.0.0 in your project
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
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
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
Version of simple-jms>simple-jms dependency
List of Version of simple-jms>simple-jms dependency
Version of simple-jndi>simple-jndi dependency
List of Version of simple-jndi>simple-jndi dependency
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 JSP program example
Simple JSP program example  Hi, How to make simple jsp program... with the simple JSP example program. Give me simple jsp program example. Thanks   HI, The very simple JSP program is to display the current date on the JSP
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
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 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 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 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 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 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 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
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
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