SlideShare a Scribd company logo
1 of 1
Download to read offline
Help in Java We refer to crew members by their ID numbers, which are integers between 0 and
999 . Every person has a unique ID; in particular, the ID of Captain Picard is 0 . Some values
between 0 and 999 may be unused, which means that the total number of crew members may be
less than 1,000 . The personnel database is a text file, which contains between 1 and 1,000 lines.
Each line includes two distinct IDs, separated by a single space. The second ID specifies the
supervisor of the person with the first ID. For example, the line "200 100" indicates that Person
100 is the supervisor of Person 200. Example file: 1220030020030000100100100200
Implement a program that counts the number of crew members, that is, the number of distinct
IDs in the personnel file. For instance, the file shown above includes six distinct IDs: 0, 1, 2,
100,200 , and 300 . Input and output: Your program should input the name of the personnel file,
and print the number of distinct IDs. The file name is a string, the length of which is between 1
and 60 . Example:

More Related Content

More from fmac5

Hello please help me how to do this project in C and explain to me h.pdf
Hello please help me how to do this project in C and explain to me h.pdfHello please help me how to do this project in C and explain to me h.pdf
Hello please help me how to do this project in C and explain to me h.pdf
fmac5
 
Gordon and Colleen Howe� Mini CaseToday is January 1, 2023.pdf
Gordon and Colleen Howe� Mini CaseToday is January 1, 2023.pdfGordon and Colleen Howe� Mini CaseToday is January 1, 2023.pdf
Gordon and Colleen Howe� Mini CaseToday is January 1, 2023.pdf
fmac5
 
Go to Previous section To Partner or Not to Partner with a Retail Co.pdf
Go to Previous section To Partner or Not to Partner with a Retail Co.pdfGo to Previous section To Partner or Not to Partner with a Retail Co.pdf
Go to Previous section To Partner or Not to Partner with a Retail Co.pdf
fmac5
 
For part B use BFS and with another loop. There is a group of p Ava .pdf
For part B use BFS and with another loop. There is a group of p Ava .pdfFor part B use BFS and with another loop. There is a group of p Ava .pdf
For part B use BFS and with another loop. There is a group of p Ava .pdf
fmac5
 

More from fmac5 (13)

Hello please help me how to do this project in C and explain to me h.pdf
Hello please help me how to do this project in C and explain to me h.pdfHello please help me how to do this project in C and explain to me h.pdf
Hello please help me how to do this project in C and explain to me h.pdf
 
Greenwich Industries entered the Latin American market in the 1950s .pdf
Greenwich Industries entered the Latin American market in the 1950s .pdfGreenwich Industries entered the Latin American market in the 1950s .pdf
Greenwich Industries entered the Latin American market in the 1950s .pdf
 
Gordon and Colleen Howe� Mini CaseToday is January 1, 2023.pdf
Gordon and Colleen Howe� Mini CaseToday is January 1, 2023.pdfGordon and Colleen Howe� Mini CaseToday is January 1, 2023.pdf
Gordon and Colleen Howe� Mini CaseToday is January 1, 2023.pdf
 
Go to Previous section To Partner or Not to Partner with a Retail Co.pdf
Go to Previous section To Partner or Not to Partner with a Retail Co.pdfGo to Previous section To Partner or Not to Partner with a Retail Co.pdf
Go to Previous section To Partner or Not to Partner with a Retail Co.pdf
 
Given the following list of accounts with normal balance, prepare a .pdf
Given the following list of accounts with normal balance, prepare a .pdfGiven the following list of accounts with normal balance, prepare a .pdf
Given the following list of accounts with normal balance, prepare a .pdf
 
Given the following challenges, use append(), extend(), pop(), and i.pdf
Given the following challenges, use append(), extend(), pop(), and i.pdfGiven the following challenges, use append(), extend(), pop(), and i.pdf
Given the following challenges, use append(), extend(), pop(), and i.pdf
 
Given Microsoft�s lackluster performance since 2000, the once domina.pdf
Given Microsoft�s lackluster performance since 2000, the once domina.pdfGiven Microsoft�s lackluster performance since 2000, the once domina.pdf
Given Microsoft�s lackluster performance since 2000, the once domina.pdf
 
Given an array of ints, return true if the number of 1s is greate.pdf
Given an array of ints, return true if the number of 1s is greate.pdfGiven an array of ints, return true if the number of 1s is greate.pdf
Given an array of ints, return true if the number of 1s is greate.pdf
 
give me an example of 6. Additional Plans Specify or re.pdf
give me an example of 6. Additional Plans Specify or re.pdfgive me an example of 6. Additional Plans Specify or re.pdf
give me an example of 6. Additional Plans Specify or re.pdf
 
Give me a substantive comment on this postThe way an organization.pdf
Give me a substantive comment on this postThe way an organization.pdfGive me a substantive comment on this postThe way an organization.pdf
Give me a substantive comment on this postThe way an organization.pdf
 
Give an extensive background of Pick n Pay. This should include info.pdf
Give an extensive background of Pick n Pay. This should include info.pdfGive an extensive background of Pick n Pay. This should include info.pdf
Give an extensive background of Pick n Pay. This should include info.pdf
 
Geoffrey This is very helpful, but I need your guidance to s.pdf
Geoffrey This is very helpful, but I need your guidance to s.pdfGeoffrey This is very helpful, but I need your guidance to s.pdf
Geoffrey This is very helpful, but I need your guidance to s.pdf
 
For part B use BFS and with another loop. There is a group of p Ava .pdf
For part B use BFS and with another loop. There is a group of p Ava .pdfFor part B use BFS and with another loop. There is a group of p Ava .pdf
For part B use BFS and with another loop. There is a group of p Ava .pdf
 

Recently uploaded

SURVEY I created for uni project research
SURVEY I created for uni project researchSURVEY I created for uni project research
SURVEY I created for uni project research
CaitlinCummins3
 
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
中 央社
 

Recently uploaded (20)

Basic Civil Engineering notes on Transportation Engineering, Modes of Transpo...
Basic Civil Engineering notes on Transportation Engineering, Modes of Transpo...Basic Civil Engineering notes on Transportation Engineering, Modes of Transpo...
Basic Civil Engineering notes on Transportation Engineering, Modes of Transpo...
 
Spring gala 2024 photo slideshow - Celebrating School-Community Partnerships
Spring gala 2024 photo slideshow - Celebrating School-Community PartnershipsSpring gala 2024 photo slideshow - Celebrating School-Community Partnerships
Spring gala 2024 photo slideshow - Celebrating School-Community Partnerships
 
SURVEY I created for uni project research
SURVEY I created for uni project researchSURVEY I created for uni project research
SURVEY I created for uni project research
 
When Quality Assurance Meets Innovation in Higher Education - Report launch w...
When Quality Assurance Meets Innovation in Higher Education - Report launch w...When Quality Assurance Meets Innovation in Higher Education - Report launch w...
When Quality Assurance Meets Innovation in Higher Education - Report launch w...
 
Envelope of Discrepancy in Orthodontics: Enhancing Precision in Treatment
 Envelope of Discrepancy in Orthodontics: Enhancing Precision in Treatment Envelope of Discrepancy in Orthodontics: Enhancing Precision in Treatment
Envelope of Discrepancy in Orthodontics: Enhancing Precision in Treatment
 
Including Mental Health Support in Project Delivery, 14 May.pdf
Including Mental Health Support in Project Delivery, 14 May.pdfIncluding Mental Health Support in Project Delivery, 14 May.pdf
Including Mental Health Support in Project Delivery, 14 May.pdf
 
Sternal Fractures & Dislocations - EMGuidewire Radiology Reading Room
Sternal Fractures & Dislocations - EMGuidewire Radiology Reading RoomSternal Fractures & Dislocations - EMGuidewire Radiology Reading Room
Sternal Fractures & Dislocations - EMGuidewire Radiology Reading Room
 
UChicago CMSC 23320 - The Best Commit Messages of 2024
UChicago CMSC 23320 - The Best Commit Messages of 2024UChicago CMSC 23320 - The Best Commit Messages of 2024
UChicago CMSC 23320 - The Best Commit Messages of 2024
 
Capitol Tech Univ Doctoral Presentation -May 2024
Capitol Tech Univ Doctoral Presentation -May 2024Capitol Tech Univ Doctoral Presentation -May 2024
Capitol Tech Univ Doctoral Presentation -May 2024
 
philosophy and it's principles based on the life
philosophy and it's principles based on the lifephilosophy and it's principles based on the life
philosophy and it's principles based on the life
 
ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...
ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...
ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...
 
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjj
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjjStl Algorithms in C++ jjjjjjjjjjjjjjjjjj
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjj
 
demyelinated disorder: multiple sclerosis.pptx
demyelinated disorder: multiple sclerosis.pptxdemyelinated disorder: multiple sclerosis.pptx
demyelinated disorder: multiple sclerosis.pptx
 
Dementia (Alzheimer & vasular dementia).
Dementia (Alzheimer & vasular dementia).Dementia (Alzheimer & vasular dementia).
Dementia (Alzheimer & vasular dementia).
 
Chapter 7 Pharmacosy Traditional System of Medicine & Ayurvedic Preparations ...
Chapter 7 Pharmacosy Traditional System of Medicine & Ayurvedic Preparations ...Chapter 7 Pharmacosy Traditional System of Medicine & Ayurvedic Preparations ...
Chapter 7 Pharmacosy Traditional System of Medicine & Ayurvedic Preparations ...
 
PSYPACT- Practicing Over State Lines May 2024.pptx
PSYPACT- Practicing Over State Lines May 2024.pptxPSYPACT- Practicing Over State Lines May 2024.pptx
PSYPACT- Practicing Over State Lines May 2024.pptx
 
Mattingly "AI and Prompt Design: LLMs with Text Classification and Open Source"
Mattingly "AI and Prompt Design: LLMs with Text Classification and Open Source"Mattingly "AI and Prompt Design: LLMs with Text Classification and Open Source"
Mattingly "AI and Prompt Design: LLMs with Text Classification and Open Source"
 
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
 
diagnosting testing bsc 2nd sem.pptx....
diagnosting testing bsc 2nd sem.pptx....diagnosting testing bsc 2nd sem.pptx....
diagnosting testing bsc 2nd sem.pptx....
 
An overview of the various scriptures in Hinduism
An overview of the various scriptures in HinduismAn overview of the various scriptures in Hinduism
An overview of the various scriptures in Hinduism
 

Help in Java We refer to crew members by their ID numbers, which are.pdf

  • 1. Help in Java We refer to crew members by their ID numbers, which are integers between 0 and 999 . Every person has a unique ID; in particular, the ID of Captain Picard is 0 . Some values between 0 and 999 may be unused, which means that the total number of crew members may be less than 1,000 . The personnel database is a text file, which contains between 1 and 1,000 lines. Each line includes two distinct IDs, separated by a single space. The second ID specifies the supervisor of the person with the first ID. For example, the line "200 100" indicates that Person 100 is the supervisor of Person 200. Example file: 1220030020030000100100100200 Implement a program that counts the number of crew members, that is, the number of distinct IDs in the personnel file. For instance, the file shown above includes six distinct IDs: 0, 1, 2, 100,200 , and 300 . Input and output: Your program should input the name of the personnel file, and print the number of distinct IDs. The file name is a string, the length of which is between 1 and 60 . Example: