Share on Google+Share on Google+

ashaanniegeorge
simple team leader
3 Answer(s)      5 years and 4 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]);

    }
}









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
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
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 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
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 problem to solve - JSP-Servlet
Simple problem to solve  Respected Sir/Madam, I am R.Ragavendran.. Thanks for your kind and timely help for the program I have asked earlier. Its working in a fantastic way. My heartiest solute to Roseindia team
Tutorials   
Java Spring Hibernate Struts Training What does core Java include? java What are some way to learn Java quickly? Is it required to learn Java before learning Java Script? Is it necessary to learn java script before learning PHP? Are HTML5 and Java Script boosts Java career? Is Java object oriented? Fingerprint application with Java Uninstall Oracle Virtual Box JSON to HashMap Free Java online Training I want example of Control Statement in Java ANSI Color Codes with Python Create a Program that Calculates Input What is difference between JDK,JRE and JVM? How to see ubuntu version on server? How to get Page Source in Selenium (WebDriver) using Java? The path to the driver executable must be set by the webdriver.gecko.driver system property parse data from a link in java Java Program Qns using BlueJ How to fix HAX Kernel Module Is Not Installed error? Installing Audacity Looking for code Logic to check track changes & Coments in MSWord, MSWordx, MSExcel, MSExcelx is ON/OFF Installing JDK on Mac SAX Parser exception ERROR 601 (42P00): Syntax error. Encountered Thread java.lang.NoClassDefFoundError: org/apache/commons/fileupload/FileItemFactory How to install Ubuntu 16.04 LTS? HttpServletRequest cannot be resolved to a type in eclipse - Solved Unhandled event loop exception GC overhead limit exceeded Spring Data jpa with apache phoenix Caused by: java.lang.IllegalArgumentException: Not a host:port pair: PBUF o.a.h.h.z.RecoverableZooKeeper - Possibly transient ZooKeeper, quorum= com.thinkaurelius.titan.diskstorage.hbase.HBaseStoreManager class not found com.thinkaurelius.titan.diskstorage.hbase.HBaseStoreManager not found How to download and install Java 8 on Windows? How to uninstall JDK 7? How to install gtk-doc-tools package in Ubuntu? How to install Oracle JDK 8 on Ubuntu? ejabberd_ctl.beam not found - Solved How to convert date to UTC format in Java? How to install autoconf, automake and libtool in Ubuntu 15.10? How to convert current date to mm dd yyyy format in Java? How to convert current date to dd mm yyyy format in Java? How to stop window closing in "internalFrameClosing" event. How to find list of all index in Neo4j? neo4j-server.properties file location SASLError using PLAIN: not-authorized how to convert war file into .exe file using java code

Ads

 
Advertisement null

Ads