SlideShare a Scribd company logo
Please help me with a UML class diagram for the following code:
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
public class FileEdit {
public static List lines = new ArrayList();
public static void main(String[] args) throws IOException
{
Scanner s = new Scanner(System.in);
System.out.print("EDIT: ");
String fileName = s.nextLine();
BufferedReader br = new BufferedReader(new FileReader(new File(fileName)));
String str="";
int count=0;
while((str=br.readLine())!=null)
{
lines.add(count, str);
System.out.println((++count) + "> "+ str);
}
String text="";
String command = "";
System.out.print((++count)+"> ");
command=s.nextLine();
String commandArr[];
int flag;
while(!command.equals("E"))
{
flag=0;
commandArr = command.split("s");
if(commandArr[0].equals("I")) //Insertion
{
while(true)
{
if(commandArr.length==1&&flag!=2)
{
System.out.print((count)+"> ");
text = s.nextLine();
insertLine(text,count-1);
}
else if(commandArr.length==2&&flag!=2)
{
System.out.print((commandArr[1])+"> ");
count=Integer.parseInt(commandArr[1]);
text = s.nextLine();
insertLine(text,Integer.parseInt(commandArr[1])-1);
}
else
insertLine(text,count-1);
System.out.print((++count)+"> ");
command=s.nextLine();
commandArr = command.split("s");
if(commandArr[0].equals("I")||commandArr[0].equals("L")||commandArr[0].equals("D")||comm
andArr[0].equals("E"))
{
flag=1;
break;
}
else
{
flag=2;
text=command;
}
}
}
else if(commandArr[0].equals("L")) //Listing
{
printList();
}
else if(commandArr[0].equals("D")) //Deletion
{
if(commandArr.length==1)
{
deleteLine(count-1,count-1);
}
else if(commandArr.length==2)
{
deleteLine(Integer.parseInt(commandArr[1])-1,Integer.parseInt(commandArr[1])-1);
}
else if(commandArr.length==3)
{
deleteLine(Integer.parseInt(commandArr[1])-1,Integer.parseInt(commandArr[2])-1);
}
count=lines.size();
}
if(flag!=1)
{
System.out.print((count++)+"> ");
command = s.nextLine();
}
}
}
public static void insertLine(String text,int count)
{
if (count >= lines.size()) {
for(int i = lines.size(); i <= count; i++) {
lines.add(null);
}
}
lines.set(count,text);
}
public static void deleteLine(int start,int end)
{
for(int i=start;i<=end;i++)
lines.remove(i);
}
public static void printList()
{
for(int i=0;i "+lines.get(i));
}
}

More Related Content

Similar to Please help me with a UML class diagram for the following code im.pdf

Java simple programs
Java simple programsJava simple programs
Java simple programs
VEERA RAGAVAN
 
An input file A1-txt is given which contains a list of integer values-.docx
An input file A1-txt is given which contains a list of integer values-.docxAn input file A1-txt is given which contains a list of integer values-.docx
An input file A1-txt is given which contains a list of integer values-.docx
lauracallander
 
3.Lesson Plan - Input.pdf.pdf
3.Lesson Plan - Input.pdf.pdf3.Lesson Plan - Input.pdf.pdf
3.Lesson Plan - Input.pdf.pdf
AbhishekSingh757567
 
Sharable_Java_Python.pdf
Sharable_Java_Python.pdfSharable_Java_Python.pdf
Sharable_Java_Python.pdf
ICADCMLTPC
 
CountStringCharacters.javaimport java.util.Scanner; public cla.pdf
CountStringCharacters.javaimport java.util.Scanner; public cla.pdfCountStringCharacters.javaimport java.util.Scanner; public cla.pdf
CountStringCharacters.javaimport java.util.Scanner; public cla.pdf
premsrivastva8
 
import java.io.BufferedReader; import java.io.IOException; impor.pdf
import java.io.BufferedReader; import java.io.IOException; impor.pdfimport java.io.BufferedReader; import java.io.IOException; impor.pdf
import java.io.BufferedReader; import java.io.IOException; impor.pdf
aravlitraders2012
 
Problem1 java codeimport java.util.Scanner; Java code to pr.pdf
 Problem1 java codeimport java.util.Scanner; Java code to pr.pdf Problem1 java codeimport java.util.Scanner; Java code to pr.pdf
Problem1 java codeimport java.util.Scanner; Java code to pr.pdf
anupamfootwear
 
Lab4
Lab4Lab4
Sam wd programs
Sam wd programsSam wd programs
Sam wd programs
Soumya Behera
 
Computer programming 2 chapter 1-lesson 2
Computer programming 2  chapter 1-lesson 2Computer programming 2  chapter 1-lesson 2
Computer programming 2 chapter 1-lesson 2
MLG College of Learning, Inc
 
CODEimport java.util.; public class test { public static voi.pdf
CODEimport java.util.; public class test { public static voi.pdfCODEimport java.util.; public class test { public static voi.pdf
CODEimport java.util.; public class test { public static voi.pdf
anurag1231
 
Prompt a user to enter a series of integers separated by spaces and .pdf
Prompt a user to enter a series of integers separated by spaces and .pdfPrompt a user to enter a series of integers separated by spaces and .pdf
Prompt a user to enter a series of integers separated by spaces and .pdf
Footageetoffe16
 
Modify the Total program so that it writes the values in two columns.pdf
Modify the Total program so that it writes the values in two columns.pdfModify the Total program so that it writes the values in two columns.pdf
Modify the Total program so that it writes the values in two columns.pdf
saxenaavnish1
 
The Java Program for the above given isimport java.io.File;impo.pdf
The Java Program for the above given isimport java.io.File;impo.pdfThe Java Program for the above given isimport java.io.File;impo.pdf
The Java Program for the above given isimport java.io.File;impo.pdf
anjanacottonmills
 
Java ppt
Java pptJava ppt
Java ppt
Rohan Gajre
 
Java practical
Java practicalJava practical
Java practical
william otto
 
Important java programs(collection+file)
Important java programs(collection+file)Important java programs(collection+file)
Important java programs(collection+file)
Alok Kumar
 
Java and j2ee_lab-manual
Java and j2ee_lab-manualJava and j2ee_lab-manual
Java and j2ee_lab-manual
hanumanthu mothukuru
 

Similar to Please help me with a UML class diagram for the following code im.pdf (18)

Java simple programs
Java simple programsJava simple programs
Java simple programs
 
An input file A1-txt is given which contains a list of integer values-.docx
An input file A1-txt is given which contains a list of integer values-.docxAn input file A1-txt is given which contains a list of integer values-.docx
An input file A1-txt is given which contains a list of integer values-.docx
 
3.Lesson Plan - Input.pdf.pdf
3.Lesson Plan - Input.pdf.pdf3.Lesson Plan - Input.pdf.pdf
3.Lesson Plan - Input.pdf.pdf
 
Sharable_Java_Python.pdf
Sharable_Java_Python.pdfSharable_Java_Python.pdf
Sharable_Java_Python.pdf
 
CountStringCharacters.javaimport java.util.Scanner; public cla.pdf
CountStringCharacters.javaimport java.util.Scanner; public cla.pdfCountStringCharacters.javaimport java.util.Scanner; public cla.pdf
CountStringCharacters.javaimport java.util.Scanner; public cla.pdf
 
import java.io.BufferedReader; import java.io.IOException; impor.pdf
import java.io.BufferedReader; import java.io.IOException; impor.pdfimport java.io.BufferedReader; import java.io.IOException; impor.pdf
import java.io.BufferedReader; import java.io.IOException; impor.pdf
 
Problem1 java codeimport java.util.Scanner; Java code to pr.pdf
 Problem1 java codeimport java.util.Scanner; Java code to pr.pdf Problem1 java codeimport java.util.Scanner; Java code to pr.pdf
Problem1 java codeimport java.util.Scanner; Java code to pr.pdf
 
Lab4
Lab4Lab4
Lab4
 
Sam wd programs
Sam wd programsSam wd programs
Sam wd programs
 
Computer programming 2 chapter 1-lesson 2
Computer programming 2  chapter 1-lesson 2Computer programming 2  chapter 1-lesson 2
Computer programming 2 chapter 1-lesson 2
 
CODEimport java.util.; public class test { public static voi.pdf
CODEimport java.util.; public class test { public static voi.pdfCODEimport java.util.; public class test { public static voi.pdf
CODEimport java.util.; public class test { public static voi.pdf
 
Prompt a user to enter a series of integers separated by spaces and .pdf
Prompt a user to enter a series of integers separated by spaces and .pdfPrompt a user to enter a series of integers separated by spaces and .pdf
Prompt a user to enter a series of integers separated by spaces and .pdf
 
Modify the Total program so that it writes the values in two columns.pdf
Modify the Total program so that it writes the values in two columns.pdfModify the Total program so that it writes the values in two columns.pdf
Modify the Total program so that it writes the values in two columns.pdf
 
The Java Program for the above given isimport java.io.File;impo.pdf
The Java Program for the above given isimport java.io.File;impo.pdfThe Java Program for the above given isimport java.io.File;impo.pdf
The Java Program for the above given isimport java.io.File;impo.pdf
 
Java ppt
Java pptJava ppt
Java ppt
 
Java practical
Java practicalJava practical
Java practical
 
Important java programs(collection+file)
Important java programs(collection+file)Important java programs(collection+file)
Important java programs(collection+file)
 
Java and j2ee_lab-manual
Java and j2ee_lab-manualJava and j2ee_lab-manual
Java and j2ee_lab-manual
 

More from aioils

Please help solve! Suppose that X is an exponential random variable .pdf
Please help solve! Suppose that X is an exponential random variable .pdfPlease help solve! Suppose that X is an exponential random variable .pdf
Please help solve! Suppose that X is an exponential random variable .pdf
aioils
 
Please help me i will give good rating a) A wheel has 37 numbers 0.pdf
Please help me i will give good rating  a) A wheel has 37 numbers 0.pdfPlease help me i will give good rating  a) A wheel has 37 numbers 0.pdf
Please help me i will give good rating a) A wheel has 37 numbers 0.pdf
aioils
 
Please help me answer this question.Explain how oxygen content acc.pdf
Please help me answer this question.Explain how oxygen content acc.pdfPlease help me answer this question.Explain how oxygen content acc.pdf
Please help me answer this question.Explain how oxygen content acc.pdf
aioils
 
PLEASE HELP IN C++For this test, you will need to create the follo.pdf
PLEASE HELP IN C++For this test, you will need to create the follo.pdfPLEASE HELP IN C++For this test, you will need to create the follo.pdf
PLEASE HELP IN C++For this test, you will need to create the follo.pdf
aioils
 
please help and thank you ! Experiments by Murphy et al. (2014) on t.pdf
please help and thank you ! Experiments by Murphy et al. (2014) on t.pdfplease help and thank you ! Experiments by Murphy et al. (2014) on t.pdf
please help and thank you ! Experiments by Murphy et al. (2014) on t.pdf
aioils
 
PLEASE HELP (also please dont answer with path because there is no .pdf
PLEASE HELP (also please dont answer with path because there is no .pdfPLEASE HELP (also please dont answer with path because there is no .pdf
PLEASE HELP (also please dont answer with path because there is no .pdf
aioils
 
please explain these topics if possible How companies account for.pdf
please explain these topics if possible  How companies account for.pdfplease explain these topics if possible  How companies account for.pdf
please explain these topics if possible How companies account for.pdf
aioils
 
Pls introduced to various themes and theoretical issues pertaining t.pdf
Pls introduced to various themes and theoretical issues pertaining t.pdfPls introduced to various themes and theoretical issues pertaining t.pdf
Pls introduced to various themes and theoretical issues pertaining t.pdf
aioils
 
please! 1. Match and pair the following basic genetic conce.pdf
please!  1. Match and pair the following basic genetic conce.pdfplease!  1. Match and pair the following basic genetic conce.pdf
please! 1. Match and pair the following basic genetic conce.pdf
aioils
 
Please write out steps )You have genotyped an entire population o.pdf
Please write out steps )You have genotyped an entire population o.pdfPlease write out steps )You have genotyped an entire population o.pdf
Please write out steps )You have genotyped an entire population o.pdf
aioils
 
Please write out the steps )_You have genotyped an entire populat.pdf
Please write out the steps )_You have genotyped an entire populat.pdfPlease write out the steps )_You have genotyped an entire populat.pdf
Please write out the steps )_You have genotyped an entire populat.pdf
aioils
 
Please Use The Code Provided below. Thanks Study the Python code .pdf
Please Use The Code Provided below. Thanks  Study the Python code .pdfPlease Use The Code Provided below. Thanks  Study the Python code .pdf
Please Use The Code Provided below. Thanks Study the Python code .pdf
aioils
 
Please Use the Code Provided below. Thanks Visit LL Queue ; add.pdf
Please Use the Code Provided below. Thanks  Visit LL Queue ; add.pdfPlease Use the Code Provided below. Thanks  Visit LL Queue ; add.pdf
Please Use the Code Provided below. Thanks Visit LL Queue ; add.pdf
aioils
 
Please this is very important Im on a deadline The joint probabilit.pdf
Please this is very important Im on a deadline The joint probabilit.pdfPlease this is very important Im on a deadline The joint probabilit.pdf
Please this is very important Im on a deadline The joint probabilit.pdf
aioils
 
Please solve. In the Assembly Department of Martinez Company, budget.pdf
Please solve. In the Assembly Department of Martinez Company, budget.pdfPlease solve. In the Assembly Department of Martinez Company, budget.pdf
Please solve. In the Assembly Department of Martinez Company, budget.pdf
aioils
 
Please do parts labeled TODO LinkedList.java Replace.pdf
Please do parts labeled TODO LinkedList.java Replace.pdfPlease do parts labeled TODO LinkedList.java Replace.pdf
Please do parts labeled TODO LinkedList.java Replace.pdf
aioils
 
Please do Part A, Ill be really gratefulThe main.c is the skeleto.pdf
Please do Part A, Ill be really gratefulThe main.c is the skeleto.pdfPlease do Part A, Ill be really gratefulThe main.c is the skeleto.pdf
Please do Part A, Ill be really gratefulThe main.c is the skeleto.pdf
aioils
 
Please do number 1 as its my choice for this project but, if there.pdf
Please do number 1 as its my choice for this project but, if there.pdfPlease do number 1 as its my choice for this project but, if there.pdf
Please do number 1 as its my choice for this project but, if there.pdf
aioils
 
Please show workstepsYou have genotyped an entire population of l.pdf
Please show workstepsYou have genotyped an entire population of l.pdfPlease show workstepsYou have genotyped an entire population of l.pdf
Please show workstepsYou have genotyped an entire population of l.pdf
aioils
 
Please show all steps of algebra. I have the answer shown below but .pdf
Please show all steps of algebra. I have the answer shown below but .pdfPlease show all steps of algebra. I have the answer shown below but .pdf
Please show all steps of algebra. I have the answer shown below but .pdf
aioils
 

More from aioils (20)

Please help solve! Suppose that X is an exponential random variable .pdf
Please help solve! Suppose that X is an exponential random variable .pdfPlease help solve! Suppose that X is an exponential random variable .pdf
Please help solve! Suppose that X is an exponential random variable .pdf
 
Please help me i will give good rating a) A wheel has 37 numbers 0.pdf
Please help me i will give good rating  a) A wheel has 37 numbers 0.pdfPlease help me i will give good rating  a) A wheel has 37 numbers 0.pdf
Please help me i will give good rating a) A wheel has 37 numbers 0.pdf
 
Please help me answer this question.Explain how oxygen content acc.pdf
Please help me answer this question.Explain how oxygen content acc.pdfPlease help me answer this question.Explain how oxygen content acc.pdf
Please help me answer this question.Explain how oxygen content acc.pdf
 
PLEASE HELP IN C++For this test, you will need to create the follo.pdf
PLEASE HELP IN C++For this test, you will need to create the follo.pdfPLEASE HELP IN C++For this test, you will need to create the follo.pdf
PLEASE HELP IN C++For this test, you will need to create the follo.pdf
 
please help and thank you ! Experiments by Murphy et al. (2014) on t.pdf
please help and thank you ! Experiments by Murphy et al. (2014) on t.pdfplease help and thank you ! Experiments by Murphy et al. (2014) on t.pdf
please help and thank you ! Experiments by Murphy et al. (2014) on t.pdf
 
PLEASE HELP (also please dont answer with path because there is no .pdf
PLEASE HELP (also please dont answer with path because there is no .pdfPLEASE HELP (also please dont answer with path because there is no .pdf
PLEASE HELP (also please dont answer with path because there is no .pdf
 
please explain these topics if possible How companies account for.pdf
please explain these topics if possible  How companies account for.pdfplease explain these topics if possible  How companies account for.pdf
please explain these topics if possible How companies account for.pdf
 
Pls introduced to various themes and theoretical issues pertaining t.pdf
Pls introduced to various themes and theoretical issues pertaining t.pdfPls introduced to various themes and theoretical issues pertaining t.pdf
Pls introduced to various themes and theoretical issues pertaining t.pdf
 
please! 1. Match and pair the following basic genetic conce.pdf
please!  1. Match and pair the following basic genetic conce.pdfplease!  1. Match and pair the following basic genetic conce.pdf
please! 1. Match and pair the following basic genetic conce.pdf
 
Please write out steps )You have genotyped an entire population o.pdf
Please write out steps )You have genotyped an entire population o.pdfPlease write out steps )You have genotyped an entire population o.pdf
Please write out steps )You have genotyped an entire population o.pdf
 
Please write out the steps )_You have genotyped an entire populat.pdf
Please write out the steps )_You have genotyped an entire populat.pdfPlease write out the steps )_You have genotyped an entire populat.pdf
Please write out the steps )_You have genotyped an entire populat.pdf
 
Please Use The Code Provided below. Thanks Study the Python code .pdf
Please Use The Code Provided below. Thanks  Study the Python code .pdfPlease Use The Code Provided below. Thanks  Study the Python code .pdf
Please Use The Code Provided below. Thanks Study the Python code .pdf
 
Please Use the Code Provided below. Thanks Visit LL Queue ; add.pdf
Please Use the Code Provided below. Thanks  Visit LL Queue ; add.pdfPlease Use the Code Provided below. Thanks  Visit LL Queue ; add.pdf
Please Use the Code Provided below. Thanks Visit LL Queue ; add.pdf
 
Please this is very important Im on a deadline The joint probabilit.pdf
Please this is very important Im on a deadline The joint probabilit.pdfPlease this is very important Im on a deadline The joint probabilit.pdf
Please this is very important Im on a deadline The joint probabilit.pdf
 
Please solve. In the Assembly Department of Martinez Company, budget.pdf
Please solve. In the Assembly Department of Martinez Company, budget.pdfPlease solve. In the Assembly Department of Martinez Company, budget.pdf
Please solve. In the Assembly Department of Martinez Company, budget.pdf
 
Please do parts labeled TODO LinkedList.java Replace.pdf
Please do parts labeled TODO LinkedList.java Replace.pdfPlease do parts labeled TODO LinkedList.java Replace.pdf
Please do parts labeled TODO LinkedList.java Replace.pdf
 
Please do Part A, Ill be really gratefulThe main.c is the skeleto.pdf
Please do Part A, Ill be really gratefulThe main.c is the skeleto.pdfPlease do Part A, Ill be really gratefulThe main.c is the skeleto.pdf
Please do Part A, Ill be really gratefulThe main.c is the skeleto.pdf
 
Please do number 1 as its my choice for this project but, if there.pdf
Please do number 1 as its my choice for this project but, if there.pdfPlease do number 1 as its my choice for this project but, if there.pdf
Please do number 1 as its my choice for this project but, if there.pdf
 
Please show workstepsYou have genotyped an entire population of l.pdf
Please show workstepsYou have genotyped an entire population of l.pdfPlease show workstepsYou have genotyped an entire population of l.pdf
Please show workstepsYou have genotyped an entire population of l.pdf
 
Please show all steps of algebra. I have the answer shown below but .pdf
Please show all steps of algebra. I have the answer shown below but .pdfPlease show all steps of algebra. I have the answer shown below but .pdf
Please show all steps of algebra. I have the answer shown below but .pdf
 

Recently uploaded

Smart-Money for SMC traders good time and ICT
Smart-Money for SMC traders good time and ICTSmart-Money for SMC traders good time and ICT
Smart-Money for SMC traders good time and ICT
simonomuemu
 
PIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf IslamabadPIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf Islamabad
AyyanKhan40
 
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
National Information Standards Organization (NISO)
 
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat  Leveraging AI for Diversity, Equity, and InclusionExecutive Directors Chat  Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
TechSoup
 
Main Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docxMain Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docx
adhitya5119
 
World environment day ppt For 5 June 2024
World environment day ppt For 5 June 2024World environment day ppt For 5 June 2024
World environment day ppt For 5 June 2024
ak6969907
 
Types of Herbal Cosmetics its standardization.
Types of Herbal Cosmetics its standardization.Types of Herbal Cosmetics its standardization.
Types of Herbal Cosmetics its standardization.
Ashokrao Mane college of Pharmacy Peth-Vadgaon
 
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Dr. Vinod Kumar Kanvaria
 
South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)
Academy of Science of South Africa
 
How to Add Chatter in the odoo 17 ERP Module
How to Add Chatter in the odoo 17 ERP ModuleHow to Add Chatter in the odoo 17 ERP Module
How to Add Chatter in the odoo 17 ERP Module
Celine George
 
Advanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docxAdvanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docx
adhitya5119
 
Hindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdfHindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdf
Dr. Mulla Adam Ali
 
DRUGS AND ITS classification slide share
DRUGS AND ITS classification slide shareDRUGS AND ITS classification slide share
DRUGS AND ITS classification slide share
taiba qazi
 
The simplified electron and muon model, Oscillating Spacetime: The Foundation...
The simplified electron and muon model, Oscillating Spacetime: The Foundation...The simplified electron and muon model, Oscillating Spacetime: The Foundation...
The simplified electron and muon model, Oscillating Spacetime: The Foundation...
RitikBhardwaj56
 
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptxChapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Mohd Adib Abd Muin, Senior Lecturer at Universiti Utara Malaysia
 
Life upper-Intermediate B2 Workbook for student
Life upper-Intermediate B2 Workbook for studentLife upper-Intermediate B2 Workbook for student
Life upper-Intermediate B2 Workbook for student
NgcHiNguyn25
 
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama UniversityNatural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
Akanksha trivedi rama nursing college kanpur.
 
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptxC1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
mulvey2
 
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
IreneSebastianRueco1
 
Pride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School DistrictPride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School District
David Douglas School District
 

Recently uploaded (20)

Smart-Money for SMC traders good time and ICT
Smart-Money for SMC traders good time and ICTSmart-Money for SMC traders good time and ICT
Smart-Money for SMC traders good time and ICT
 
PIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf IslamabadPIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf Islamabad
 
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
 
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat  Leveraging AI for Diversity, Equity, and InclusionExecutive Directors Chat  Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
 
Main Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docxMain Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docx
 
World environment day ppt For 5 June 2024
World environment day ppt For 5 June 2024World environment day ppt For 5 June 2024
World environment day ppt For 5 June 2024
 
Types of Herbal Cosmetics its standardization.
Types of Herbal Cosmetics its standardization.Types of Herbal Cosmetics its standardization.
Types of Herbal Cosmetics its standardization.
 
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
 
South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)
 
How to Add Chatter in the odoo 17 ERP Module
How to Add Chatter in the odoo 17 ERP ModuleHow to Add Chatter in the odoo 17 ERP Module
How to Add Chatter in the odoo 17 ERP Module
 
Advanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docxAdvanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docx
 
Hindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdfHindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdf
 
DRUGS AND ITS classification slide share
DRUGS AND ITS classification slide shareDRUGS AND ITS classification slide share
DRUGS AND ITS classification slide share
 
The simplified electron and muon model, Oscillating Spacetime: The Foundation...
The simplified electron and muon model, Oscillating Spacetime: The Foundation...The simplified electron and muon model, Oscillating Spacetime: The Foundation...
The simplified electron and muon model, Oscillating Spacetime: The Foundation...
 
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptxChapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
 
Life upper-Intermediate B2 Workbook for student
Life upper-Intermediate B2 Workbook for studentLife upper-Intermediate B2 Workbook for student
Life upper-Intermediate B2 Workbook for student
 
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama UniversityNatural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
 
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptxC1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
 
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
 
Pride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School DistrictPride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School District
 

Please help me with a UML class diagram for the following code im.pdf

  • 1. Please help me with a UML class diagram for the following code: import java.io.BufferedReader; import java.io.File; import java.io.FileReader; import java.io.IOException; import java.util.ArrayList; import java.util.List; import java.util.Scanner; public class FileEdit { public static List lines = new ArrayList(); public static void main(String[] args) throws IOException { Scanner s = new Scanner(System.in); System.out.print("EDIT: "); String fileName = s.nextLine(); BufferedReader br = new BufferedReader(new FileReader(new File(fileName))); String str=""; int count=0; while((str=br.readLine())!=null) { lines.add(count, str); System.out.println((++count) + "> "+ str); } String text=""; String command = ""; System.out.print((++count)+"> "); command=s.nextLine(); String commandArr[]; int flag; while(!command.equals("E")) { flag=0; commandArr = command.split("s"); if(commandArr[0].equals("I")) //Insertion {
  • 2. while(true) { if(commandArr.length==1&&flag!=2) { System.out.print((count)+"> "); text = s.nextLine(); insertLine(text,count-1); } else if(commandArr.length==2&&flag!=2) { System.out.print((commandArr[1])+"> "); count=Integer.parseInt(commandArr[1]); text = s.nextLine(); insertLine(text,Integer.parseInt(commandArr[1])-1); } else insertLine(text,count-1); System.out.print((++count)+"> "); command=s.nextLine(); commandArr = command.split("s"); if(commandArr[0].equals("I")||commandArr[0].equals("L")||commandArr[0].equals("D")||comm andArr[0].equals("E")) { flag=1; break; } else { flag=2; text=command; } } } else if(commandArr[0].equals("L")) //Listing { printList();
  • 3. } else if(commandArr[0].equals("D")) //Deletion { if(commandArr.length==1) { deleteLine(count-1,count-1); } else if(commandArr.length==2) { deleteLine(Integer.parseInt(commandArr[1])-1,Integer.parseInt(commandArr[1])-1); } else if(commandArr.length==3) { deleteLine(Integer.parseInt(commandArr[1])-1,Integer.parseInt(commandArr[2])-1); } count=lines.size(); } if(flag!=1) { System.out.print((count++)+"> "); command = s.nextLine(); } } } public static void insertLine(String text,int count) { if (count >= lines.size()) { for(int i = lines.size(); i <= count; i++) { lines.add(null); } } lines.set(count,text); } public static void deleteLine(int start,int end) { for(int i=start;i<=end;i++)
  • 4. lines.remove(i); } public static void printList() { for(int i=0;i "+lines.get(i)); } }