SlideShare a Scribd company logo
Final Work sheet
Student Name: Shubham Roy UID: 21MCA2028
Branch: MCA Section/Group: 21MCA-6_A
Semester: 2nd
sem Date of Performance: 20/05/22
Subject Name: Advanced Internet Programming Lab Subject Code: 21CAP-655
1. Aim/Overview of the practical:
2. Task to be done:
1. WAP to create a class employee and store information of n number of
employees of different departments. Use the concept of inheritance and
polymorphism.
2. WAP to insert a string into another string.
3. Steps for experiment/practical:
Code: 1st
problem
class employe
{
protected int emp_no;
protected String name;
protected int salary;
public
employe(int empno,String nam,int sal)
{
emp_no=empno;
name=nam;
salary=sal;
}
public void emplo_data()
{
System.out.println("nEmploy no.="+emp_no);
System.out.println("Name="+name);
System.out.println("Salary="+salary);
}
}
class manager extends employe
{
int reward;
public manager(int empno,String nam,int sal,int p)
{
super(empno,nam,sal);
reward=p;
}
public void managerdata()
{
System.out.println("nEmploy no.="+emp_no);
System.out.println("Name="+name);
System.out.println("Salary="+salary);
System.out.println("Reward="+reward);
}
}
class scientist extends employe
{
int perks;
public scientist(int empno,String nam,int sal,int s)
{
super(empno,nam,sal);
perks=s;
}
public void scientistdata()
{
System.out.println("nEmploy no.="+emp_no);
System.out.println("Name="+name);
System.out.println("Salary="+salary);
System.out.println("Perks="+perks);
}
}
class inheritance
{
public static void main(String args[])
{
employe emp= new employe(1,"ABCt",30000);
emp.emplo_data();
manager man= new manager(2,"DEFt",60000,1000);
man.managerdata();
scientist scient= new scientist(3,"Higt",50000,3000);
scient.scientistdata();
}
}
Output of 1st
problem:
Code: 2nd
program:
import java.lang.*;
import java.util.*;
class StrInsert {
public static void main(String[] args)
{
Scanner input=new Scanner(System.in);
// Input original string
System.out.println("Enter the Original String: ");
String firStr = input.nextLine();
//Input the second string to be inserted
System.out.println("Enter the String to be Inserted: ");
String secStr = input.nextLine();
//Input the index after which the string should be inserted
System.out.println("Enter the Index: ");
int index = input.nextInt();
//New string using substring() method
String newStr = firStr.substring(0, index + 1)
+ secStr + firStr.substring(index + 1);
// Output
System.out.println("New String After Insertion: "+ newStr);
}
}
Output for 2nd
program:

More Related Content

Similar to AIP Lab final ws.pdf

Cs141 mid termexam2_v1answer
Cs141 mid termexam2_v1answerCs141 mid termexam2_v1answer
Cs141 mid termexam2_v1answer
Fahadaio
 
exp 1 internet programing.docx
exp 1 internet programing.docxexp 1 internet programing.docx
exp 1 internet programing.docx
ApkaAmitbro
 
Lecture_7-Encapsulation in Java.pptx
Lecture_7-Encapsulation in Java.pptxLecture_7-Encapsulation in Java.pptx
Lecture_7-Encapsulation in Java.pptx
ShahinAhmed49
 
22316-2019-Summer-model-answer-paper.pdf
22316-2019-Summer-model-answer-paper.pdf22316-2019-Summer-model-answer-paper.pdf
22316-2019-Summer-model-answer-paper.pdf
PradipShinde53
 
Cis247 i lab 3 overloaded methods and static methods variables
Cis247 i lab 3 overloaded methods and static methods variablesCis247 i lab 3 overloaded methods and static methods variables
Cis247 i lab 3 overloaded methods and static methods variables
sdjdskjd9097
 
Session - 1 Forms and Session management.pptx
Session - 1 Forms and Session management.pptxSession - 1 Forms and Session management.pptx
Session - 1 Forms and Session management.pptx
imjdabhinawpandey
 
Cis247 a ilab 3 overloaded methods and static methods variables
Cis247 a ilab 3 overloaded methods and static methods variablesCis247 a ilab 3 overloaded methods and static methods variables
Cis247 a ilab 3 overloaded methods and static methods variables
ccis224477
 
Java programming concept
Java programming conceptJava programming concept
Java programming concept
Sanjay Gunjal
 
studentinformationsystem-160525081807.pdf
studentinformationsystem-160525081807.pdfstudentinformationsystem-160525081807.pdf
studentinformationsystem-160525081807.pdf
SayantanMajhi2
 
studentinformationsystem-160525081807.pdf
studentinformationsystem-160525081807.pdfstudentinformationsystem-160525081807.pdf
studentinformationsystem-160525081807.pdf
SayantanMajhi2
 
studentinformationsystem-160525081807.pdf
studentinformationsystem-160525081807.pdfstudentinformationsystem-160525081807.pdf
studentinformationsystem-160525081807.pdf
SayantanMajhi2
 
Student information system
Student information systemStudent information system
Student information system
Saqib Nadeem
 
Amar Resume prajapati with experience
Amar Resume prajapati with experienceAmar Resume prajapati with experience
Amar Resume prajapati with experience
Amar kumar
 
Online_Examination
Online_ExaminationOnline_Examination
Online_Examination
Rupam Dey
 
4CS4-25-Java-Lab-Manual.pdf
4CS4-25-Java-Lab-Manual.pdf4CS4-25-Java-Lab-Manual.pdf
4CS4-25-Java-Lab-Manual.pdf
amitbhachne
 
GSP 125 Entire Course NEW
GSP 125 Entire Course NEWGSP 125 Entire Course NEW
GSP 125 Entire Course NEW
shyamuopten
 
AJP
AJPAJP
Mis 589 Success Begins / snaptutorial.com
Mis 589  Success Begins / snaptutorial.comMis 589  Success Begins / snaptutorial.com
Mis 589 Success Begins / snaptutorial.com
WilliamsTaylor44
 
Mis 589 Massive Success / snaptutorial.com
Mis 589 Massive Success / snaptutorial.comMis 589 Massive Success / snaptutorial.com
Mis 589 Massive Success / snaptutorial.com
Stephenson185
 
c++ lab manual
c++ lab manualc++ lab manual
c++ lab manual
Shrunkhala Wankhede
 

Similar to AIP Lab final ws.pdf (20)

Cs141 mid termexam2_v1answer
Cs141 mid termexam2_v1answerCs141 mid termexam2_v1answer
Cs141 mid termexam2_v1answer
 
exp 1 internet programing.docx
exp 1 internet programing.docxexp 1 internet programing.docx
exp 1 internet programing.docx
 
Lecture_7-Encapsulation in Java.pptx
Lecture_7-Encapsulation in Java.pptxLecture_7-Encapsulation in Java.pptx
Lecture_7-Encapsulation in Java.pptx
 
22316-2019-Summer-model-answer-paper.pdf
22316-2019-Summer-model-answer-paper.pdf22316-2019-Summer-model-answer-paper.pdf
22316-2019-Summer-model-answer-paper.pdf
 
Cis247 i lab 3 overloaded methods and static methods variables
Cis247 i lab 3 overloaded methods and static methods variablesCis247 i lab 3 overloaded methods and static methods variables
Cis247 i lab 3 overloaded methods and static methods variables
 
Session - 1 Forms and Session management.pptx
Session - 1 Forms and Session management.pptxSession - 1 Forms and Session management.pptx
Session - 1 Forms and Session management.pptx
 
Cis247 a ilab 3 overloaded methods and static methods variables
Cis247 a ilab 3 overloaded methods and static methods variablesCis247 a ilab 3 overloaded methods and static methods variables
Cis247 a ilab 3 overloaded methods and static methods variables
 
Java programming concept
Java programming conceptJava programming concept
Java programming concept
 
studentinformationsystem-160525081807.pdf
studentinformationsystem-160525081807.pdfstudentinformationsystem-160525081807.pdf
studentinformationsystem-160525081807.pdf
 
studentinformationsystem-160525081807.pdf
studentinformationsystem-160525081807.pdfstudentinformationsystem-160525081807.pdf
studentinformationsystem-160525081807.pdf
 
studentinformationsystem-160525081807.pdf
studentinformationsystem-160525081807.pdfstudentinformationsystem-160525081807.pdf
studentinformationsystem-160525081807.pdf
 
Student information system
Student information systemStudent information system
Student information system
 
Amar Resume prajapati with experience
Amar Resume prajapati with experienceAmar Resume prajapati with experience
Amar Resume prajapati with experience
 
Online_Examination
Online_ExaminationOnline_Examination
Online_Examination
 
4CS4-25-Java-Lab-Manual.pdf
4CS4-25-Java-Lab-Manual.pdf4CS4-25-Java-Lab-Manual.pdf
4CS4-25-Java-Lab-Manual.pdf
 
GSP 125 Entire Course NEW
GSP 125 Entire Course NEWGSP 125 Entire Course NEW
GSP 125 Entire Course NEW
 
AJP
AJPAJP
AJP
 
Mis 589 Success Begins / snaptutorial.com
Mis 589  Success Begins / snaptutorial.comMis 589  Success Begins / snaptutorial.com
Mis 589 Success Begins / snaptutorial.com
 
Mis 589 Massive Success / snaptutorial.com
Mis 589 Massive Success / snaptutorial.comMis 589 Massive Success / snaptutorial.com
Mis 589 Massive Success / snaptutorial.com
 
c++ lab manual
c++ lab manualc++ lab manual
c++ lab manual
 

Recently uploaded

Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
KatiaHIMEUR1
 
“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”
Claudio Di Ciccio
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
Kari Kakkonen
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
Matthew Sinclair
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
Neo4j
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
Matthew Sinclair
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
Adtran
 
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
Neo4j
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
sonjaschweigert1
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Aggregage
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
danishmna97
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
SOFTTECHHUB
 
How to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For FlutterHow to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For Flutter
Daiki Mogmet Ito
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems S.M.S.A.
 
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
SOFTTECHHUB
 
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
Neo4j
 
UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
DianaGray10
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
Alpen-Adria-Universität
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
DianaGray10
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
KAMESHS29
 

Recently uploaded (20)

Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
 
“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
 
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
 
How to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For FlutterHow to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For Flutter
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
 
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
 
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
 
UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
 

AIP Lab final ws.pdf

  • 1. Final Work sheet Student Name: Shubham Roy UID: 21MCA2028 Branch: MCA Section/Group: 21MCA-6_A Semester: 2nd sem Date of Performance: 20/05/22 Subject Name: Advanced Internet Programming Lab Subject Code: 21CAP-655 1. Aim/Overview of the practical: 2. Task to be done: 1. WAP to create a class employee and store information of n number of employees of different departments. Use the concept of inheritance and polymorphism. 2. WAP to insert a string into another string. 3. Steps for experiment/practical: Code: 1st problem class employe { protected int emp_no; protected String name; protected int salary;
  • 2. public employe(int empno,String nam,int sal) { emp_no=empno; name=nam; salary=sal; } public void emplo_data() { System.out.println("nEmploy no.="+emp_no); System.out.println("Name="+name); System.out.println("Salary="+salary); } } class manager extends employe { int reward; public manager(int empno,String nam,int sal,int p) { super(empno,nam,sal); reward=p; } public void managerdata() { System.out.println("nEmploy no.="+emp_no);
  • 3. System.out.println("Name="+name); System.out.println("Salary="+salary); System.out.println("Reward="+reward); } } class scientist extends employe { int perks; public scientist(int empno,String nam,int sal,int s) { super(empno,nam,sal); perks=s; } public void scientistdata() { System.out.println("nEmploy no.="+emp_no); System.out.println("Name="+name); System.out.println("Salary="+salary); System.out.println("Perks="+perks); } } class inheritance { public static void main(String args[])
  • 4. { employe emp= new employe(1,"ABCt",30000); emp.emplo_data(); manager man= new manager(2,"DEFt",60000,1000); man.managerdata(); scientist scient= new scientist(3,"Higt",50000,3000); scient.scientistdata(); } } Output of 1st problem:
  • 5. Code: 2nd program: import java.lang.*; import java.util.*; class StrInsert { public static void main(String[] args) { Scanner input=new Scanner(System.in); // Input original string System.out.println("Enter the Original String: "); String firStr = input.nextLine(); //Input the second string to be inserted System.out.println("Enter the String to be Inserted: "); String secStr = input.nextLine(); //Input the index after which the string should be inserted System.out.println("Enter the Index: "); int index = input.nextInt(); //New string using substring() method String newStr = firStr.substring(0, index + 1) + secStr + firStr.substring(index + 1); // Output System.out.println("New String After Insertion: "+ newStr); } }