simple team leader

simple team leader

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

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
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
Advertisements
ModuleNotFoundError: No module named 'cmsplugin-team'
ModuleNotFoundError: No module named 'cmsplugin-team'  Hi, My... named 'cmsplugin-team' How to remove the ModuleNotFoundError: No module named 'cmsplugin-team' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'leonardo-team'
ModuleNotFoundError: No module named 'leonardo-team'  Hi, My... 'leonardo-team' How to remove the ModuleNotFoundError: No module named 'leonardo-team' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'leonardo-team'
ModuleNotFoundError: No module named 'leonardo-team'  Hi, My... 'leonardo-team' How to remove the ModuleNotFoundError: No module named 'leonardo-team' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'team-mates'
ModuleNotFoundError: No module named 'team-mates'  Hi, My Python... 'team-mates' How to remove the ModuleNotFoundError: No module named 'team... have to install padas library. You can install team-mates python
ModuleNotFoundError: No module named 'cmsplugin-team'
ModuleNotFoundError: No module named 'cmsplugin-team'  Hi, My... named 'cmsplugin-team' How to remove the ModuleNotFoundError: No module named 'cmsplugin-team' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'helga-team'
ModuleNotFoundError: No module named 'helga-team'  Hi, My Python... 'helga-team' How to remove the ModuleNotFoundError: No module named 'helga-team' error? Thanks   Hi, In your python environment you
ModuleNotFoundError: No module named 'khl_team'
ModuleNotFoundError: No module named 'khl_team'  Hi, My Python..._team' How to remove the ModuleNotFoundError: No module named 'khl_team... to install padas library. You can install khl_team python with following
ModuleNotFoundError: No module named 'django-monkey-team'
ModuleNotFoundError: No module named 'django-monkey-team'  Hi, My... named 'django-monkey-team' How to remove the ModuleNotFoundError: No module named 'django-monkey-team' error? Thanks   Hi, In your
ModuleNotFoundError: No module named 'finance-team-api'
ModuleNotFoundError: No module named 'finance-team-api'  Hi, My... named 'finance-team-api' How to remove the ModuleNotFoundError: No module named 'finance-team-api' error? Thanks   Hi, In your
ModuleNotFoundError: No module named 'github-team-organizer'
ModuleNotFoundError: No module named 'github-team-organizer'  Hi...: No module named 'github-team-organizer' How to remove the ModuleNotFoundError: No module named 'github-team-organizer' error? Thanks   Hi
ModuleNotFoundError: No module named 'MBD_TEAM_B'
ModuleNotFoundError: No module named 'MBD_TEAM_B'  Hi, My Python... 'MBD_TEAM_B' How to remove the ModuleNotFoundError: No module named 'MBD_TEAM_B' error? Thanks   Hi, In your python environment you
ModuleNotFoundError: No module named 'MBD_TEAM_B'
ModuleNotFoundError: No module named 'MBD_TEAM_B'  Hi, My Python... 'MBD_TEAM_B' How to remove the ModuleNotFoundError: No module named 'MBD_TEAM_B' error? Thanks   Hi, In your python environment you
ModuleNotFoundError: No module named 'odoo10-addon-quality-control-team'
ModuleNotFoundError: No module named 'odoo10-addon-quality-control-team' ...: ModuleNotFoundError: No module named 'odoo10-addon-quality-control-team' How to remove the ModuleNotFoundError: No module named 'odoo10-addon-quality-control-team'
ModuleNotFoundError: No module named 'odoo10-addon-quality-control-team'
ModuleNotFoundError: No module named 'odoo10-addon-quality-control-team' ...: ModuleNotFoundError: No module named 'odoo10-addon-quality-control-team' How to remove the ModuleNotFoundError: No module named 'odoo10-addon-quality-control-team'
ModuleNotFoundError: No module named 'odoo11-addon-mail-activity-team'
ModuleNotFoundError: No module named 'odoo11-addon-mail-activity-team' ...: ModuleNotFoundError: No module named 'odoo11-addon-mail-activity-team' How to remove the ModuleNotFoundError: No module named 'odoo11-addon-mail-activity-team' error
ModuleNotFoundError: No module named 'odoo11-addon-maintenance-team-hierarchy'
ModuleNotFoundError: No module named 'odoo11-addon-maintenance-team-hierarchy...: ModuleNotFoundError: No module named 'odoo11-addon-maintenance-team-hierarchy' How...-team-hierarchy' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'odoo11-addon-oca-psc-team'
ModuleNotFoundError: No module named 'odoo11-addon-oca-psc-team'  Hi...: No module named 'odoo11-addon-oca-psc-team' How to remove the ModuleNotFoundError: No module named 'odoo11-addon-oca-psc-team' error? Thanks  
ModuleNotFoundError: No module named 'odoo11-addon-quality-control-team'
ModuleNotFoundError: No module named 'odoo11-addon-quality-control-team' ...: ModuleNotFoundError: No module named 'odoo11-addon-quality-control-team' How to remove the ModuleNotFoundError: No module named 'odoo11-addon-quality-control-team'
ModuleNotFoundError: No module named 'odoo11-addon-sales-team-security'
ModuleNotFoundError: No module named 'odoo11-addon-sales-team-security' ...: ModuleNotFoundError: No module named 'odoo11-addon-sales-team-security' How to remove the ModuleNotFoundError: No module named 'odoo11-addon-sales-team-security'
ModuleNotFoundError: No module named 'odoo12-addon-mail-activity-team'
ModuleNotFoundError: No module named 'odoo12-addon-mail-activity-team' ...: ModuleNotFoundError: No module named 'odoo12-addon-mail-activity-team' How to remove the ModuleNotFoundError: No module named 'odoo12-addon-mail-activity-team' error
ModuleNotFoundError: No module named 'odoo12-addon-mail-activity-team'
ModuleNotFoundError: No module named 'odoo12-addon-mail-activity-team' ...: ModuleNotFoundError: No module named 'odoo12-addon-mail-activity-team' How to remove the ModuleNotFoundError: No module named 'odoo12-addon-mail-activity-team' error
ModuleNotFoundError: No module named 'odoo12-addon-maintenance-team-hierarchy'
ModuleNotFoundError: No module named 'odoo12-addon-maintenance-team-hierarchy...: ModuleNotFoundError: No module named 'odoo12-addon-maintenance-team-hierarchy' How...-team-hierarchy' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'odoo12-addon-maintenance-team-hierarchy'
ModuleNotFoundError: No module named 'odoo12-addon-maintenance-team-hierarchy...: ModuleNotFoundError: No module named 'odoo12-addon-maintenance-team-hierarchy' How...-team-hierarchy' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'odoo12-addon-oca-psc-team'
ModuleNotFoundError: No module named 'odoo12-addon-oca-psc-team'  Hi...: No module named 'odoo12-addon-oca-psc-team' How to remove the ModuleNotFoundError: No module named 'odoo12-addon-oca-psc-team' error? Thanks  
ModuleNotFoundError: No module named 'odoo12-addon-oca-psc-team'
ModuleNotFoundError: No module named 'odoo12-addon-oca-psc-team'  Hi...: No module named 'odoo12-addon-oca-psc-team' How to remove the ModuleNotFoundError: No module named 'odoo12-addon-oca-psc-team' error? Thanks  
ModuleNotFoundError: No module named 'odoo12-addon-oca-psc-team'
ModuleNotFoundError: No module named 'odoo12-addon-oca-psc-team'  Hi...: No module named 'odoo12-addon-oca-psc-team' How to remove the ModuleNotFoundError: No module named 'odoo12-addon-oca-psc-team' error? Thanks  
ModuleNotFoundError: No module named 'odoo12-addon-quality-control-team'
ModuleNotFoundError: No module named 'odoo12-addon-quality-control-team' ...: ModuleNotFoundError: No module named 'odoo12-addon-quality-control-team' How to remove the ModuleNotFoundError: No module named 'odoo12-addon-quality-control-team'
ModuleNotFoundError: No module named 'odoo12-addon-quality-control-team'
ModuleNotFoundError: No module named 'odoo12-addon-quality-control-team' ...: ModuleNotFoundError: No module named 'odoo12-addon-quality-control-team' How to remove the ModuleNotFoundError: No module named 'odoo12-addon-quality-control-team'
ModuleNotFoundError: No module named 'odoo12-addon-sales-team-security'
ModuleNotFoundError: No module named 'odoo12-addon-sales-team-security' ...: ModuleNotFoundError: No module named 'odoo12-addon-sales-team-security' How to remove the ModuleNotFoundError: No module named 'odoo12-addon-sales-team-security'
ModuleNotFoundError: No module named 'odoo12-addon-sales-team-security'
ModuleNotFoundError: No module named 'odoo12-addon-sales-team-security' ...: ModuleNotFoundError: No module named 'odoo12-addon-sales-team-security' How to remove the ModuleNotFoundError: No module named 'odoo12-addon-sales-team-security'
ModuleNotFoundError: No module named 'odoo13-addon-mail-activity-team'
ModuleNotFoundError: No module named 'odoo13-addon-mail-activity-team' ...: ModuleNotFoundError: No module named 'odoo13-addon-mail-activity-team' How to remove the ModuleNotFoundError: No module named 'odoo13-addon-mail-activity-team' error
ModuleNotFoundError: No module named 'odoo8-addon-sales-team-security'
ModuleNotFoundError: No module named 'odoo8-addon-sales-team-security' ...: ModuleNotFoundError: No module named 'odoo8-addon-sales-team-security' How to remove the ModuleNotFoundError: No module named 'odoo8-addon-sales-team-security' error
ModuleNotFoundError: No module named 'odoo9-addon-quality-control-team'
ModuleNotFoundError: No module named 'odoo9-addon-quality-control-team' ...: ModuleNotFoundError: No module named 'odoo9-addon-quality-control-team' How to remove the ModuleNotFoundError: No module named 'odoo9-addon-quality-control-team'
ModuleNotFoundError: No module named 'odoo9-addon-sales-team-multicompany'
ModuleNotFoundError: No module named 'odoo9-addon-sales-team-multicompany' ...: ModuleNotFoundError: No module named 'odoo9-addon-sales-team-multicompany' How to remove the ModuleNotFoundError: No module named 'odoo9-addon-sales-team
ModuleNotFoundError: No module named 'OLS-team-cool'
ModuleNotFoundError: No module named 'OLS-team-cool'  Hi, My... 'OLS-team-cool' How to remove the ModuleNotFoundError: No module named 'OLS-team-cool' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'team_center_api'
ModuleNotFoundError: No module named 'team_center_api'  Hi, My... named 'team_center_api' How to remove the ModuleNotFoundError: No module named 'team_center_api' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'team_center_api'
ModuleNotFoundError: No module named 'team_center_api'  Hi, My... named 'team_center_api' How to remove the ModuleNotFoundError: No module named 'team_center_api' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'team_center_api'
ModuleNotFoundError: No module named 'team_center_api'  Hi, My... named 'team_center_api' How to remove the ModuleNotFoundError: No module named 'team_center_api' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'team_city_test_analyzer'
ModuleNotFoundError: No module named 'team_city_test_analyzer'  Hi...: No module named 'team_city_test_analyzer' How to remove the ModuleNotFoundError: No module named 'team_city_test_analyzer' error? Thanks   
ModuleNotFoundError: No module named 'team-cymru-api'
ModuleNotFoundError: No module named 'team-cymru-api'  Hi, My... named 'team-cymru-api' How to remove the ModuleNotFoundError: No module named 'team-cymru-api' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'team_password_cli'
ModuleNotFoundError: No module named 'team_password_cli'  Hi, My... named 'team_password_cli' How to remove the ModuleNotFoundError: No module named 'team_password_cli' error? Thanks   Hi, In your
ModuleNotFoundError: No module named 'vsts-cli-team'
ModuleNotFoundError: No module named 'vsts-cli-team'  Hi, My... 'vsts-cli-team' How to remove the ModuleNotFoundError: No module named 'vsts-cli-team' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'vsts-cli-team-common'
ModuleNotFoundError: No module named 'vsts-cli-team-common'  Hi...: No module named 'vsts-cli-team-common' How to remove the ModuleNotFoundError: No module named 'vsts-cli-team-common' error? Thanks   Hi
ModuleNotFoundError: No module named 'ahlev-django-team'
ModuleNotFoundError: No module named 'ahlev-django-team'  Hi, My... named 'ahlev-django-team' How to remove the ModuleNotFoundError: No module named 'ahlev-django-team' error? Thanks   Hi, In your
ModuleNotFoundError: No module named 'django-monkey-team'
ModuleNotFoundError: No module named 'django-monkey-team'  Hi, My... named 'django-monkey-team' How to remove the ModuleNotFoundError: No module named 'django-monkey-team' error? Thanks   Hi, In your
ModuleNotFoundError: No module named 'finance-team-api'
ModuleNotFoundError: No module named 'finance-team-api'  Hi, My... named 'finance-team-api' How to remove the ModuleNotFoundError: No module named 'finance-team-api' error? Thanks   Hi, In your
ModuleNotFoundError: No module named 'github-team-organizer'
ModuleNotFoundError: No module named 'github-team-organizer'  Hi...: No module named 'github-team-organizer' How to remove the ModuleNotFoundError: No module named 'github-team-organizer' error? Thanks   Hi
ModuleNotFoundError: No module named 'odoo10-addon-sales-team-operating-unit'
ModuleNotFoundError: No module named 'odoo10-addon-sales-team-operating-unit...: ModuleNotFoundError: No module named 'odoo10-addon-sales-team-operating-unit' How to remove the ModuleNotFoundError: No module named 'odoo10-addon-sales-team

Ads