SlideShare a Scribd company logo
Python Program
Do not use import please. Problem 1: Rolodex (Note: A Rolodex is a Contact List) Write a
program that manages a rolodex. This program prompts the user for the name of a rol file. This
program should be able to load any rol file and require that the file extension -i.e the last 4 letters
of the file be rol. The file rol is consider a valid file. If the file exists the program loads in the
contacts stored in the file. A Rolodex contains unique individuals, no duplicate names are
allowed. However, name lookups are case sensitive, so "Apple" and "apple" are considered
different names allowed However, name
Solution
Rolodex.java
public class Rolodex{
String name;
String phone;
String email;
String note;
Rolodex(String name,String phone,String email,String note){
this.name=name;
this.phone=phone;
this.email=email;
this.note=note;
}
public String tostring(){
return "name:"+name+" phone:"+phone +" email:"+email+ " note:"+note;
}
}
rolodexmain.java
import java.util.*;
public class rolodexmain {
static Scanner sc=new Scanner(System.in);
static Listlist=new ArrayList();
static Setsets=new HashSet();
public static void main(String[] args) {
// TODO Auto-generated method stub
while(true){
System.out.println("Rolodex comands t Insert(i),remove(R),
Lookbyname(F),LookbyPhone number(N),Lookby email(E)saves(S),save and
quit(Q),printall(P),quit and dont save(X)");
char ch=sc.next().charAt(0);
switch(ch){
case 'I':
insert(list);
break;
case 'R':
deleted(list);
break;
case 'F':
Lookbyname(list);
break;
case 'N':
Lookbyphonenumber(list);
break;
case 'E':
Lookbyemail(list);
break;
case 'P':
printall(list);
break;
case 'X':
System.exit(0);
case 'S':
saves(list);
break;
case 'Q':
savesandquit(list);
System.exit(0);
}
}
}
public static void insert(List list){
System.out.println("please enter contact name:");
String name=sc.next();
System.out.println("please enter contact phone number:");
String phone=sc.next();
System.out.println("please enter contact email id:");
String email=sc.next();
System.out.println("please enter contact note:");
String note=sc.next();
Rolodex r=new Rolodex(name,phone,email,note);
list.add(r);
}
public static void deleted(List list){
boolean flag=false;
System.out.println("enter name of contact to delete :");
String dname=sc.next();
for(int i=0;i list){
System.out.println("enter name of contact which you want to look :");
String lname=sc.next();
for(int i=0;i list){
System.out.println("please enter phone number which you want to look:");
String lphone=sc.next();
for(int i=0;i list){
System.out.println("please enter phone number which you want to look:");
String lemail=sc.next();
for(int i=0;i list){
for(int i=0;i list){
sets.addAll(list);
for (Rolodex o : sets) {
// Rolodex r=(Rolodex)sets;
System.out.println(o.tostring());
}
}
public static void savesandquit(List list){
sets.addAll(list);
for (Rolodex o : sets) {
// Rolodex r=(Rolodex)sets;
System.out.println(o.tostring());
}
}
}
output:
Rolodex comands Insert(i),remove(R), Lookbyname(F),LookbyPhone number(N),Lookby
email(E)saves(S),save and quit(Q),printall(P),quit and dont save(X)
I
please enter contact name:
SWARUP
please enter contact phone number:
567889
please enter contact email id:
SWARUP@
please enter contact note:
CONTACT
Rolodex comands Insert(i),remove(R), Lookbyname(F),LookbyPhone number(N),Lookby
email(E)saves(S),save and quit(Q),printall(P),quit and dont save(X)
I
please enter contact name:
ALISA
please enter contact phone number:
123
please enter contact email id:
ALISE@
please enter contact note:
NEW
Rolodex comands Insert(i),remove(R), Lookbyname(F),LookbyPhone number(N),Lookby
email(E)saves(S),save and quit(Q),printall(P),quit and dont save(X)
F
enter name of contact which you want to look :
SWARUP
name:SWARUP
phone:567889
email:SWARUP@
note:CONTACT
Rolodex comands Insert(i),remove(R), Lookbyname(F),LookbyPhone number(N),Lookby
email(E)saves(S),save and quit(Q),printall(P),quit and dont save(X)
N
please enter phone number which you want to look:
567889
name:SWARUP
phone:567889
email:SWARUP@
note:CONTACT
Rolodex comands Insert(i),remove(R), Lookbyname(F),LookbyPhone number(N),Lookby
email(E)saves(S),save and quit(Q),printall(P),quit and dont save(X)
E
please enter phone number which you want to look:
ALISE@
name:ALISA
phone:123
email:ALISE@
note:NEW
Rolodex comands Insert(i),remove(R), Lookbyname(F),LookbyPhone number(N),Lookby
email(E)saves(S),save and quit(Q),printall(P),quit and dont save(X)
P
name:SWARUP
phone:567889
email:SWARUP@
note:CONTACT
name:ALISA
phone:123
email:ALISE@
note:NEW
Rolodex comands Insert(i),remove(R), Lookbyname(F),LookbyPhone number(N),Lookby
email(E)saves(S),save and quit(Q),printall(P),quit and dont save(X)
S
name:ALISA
phone:123
email:ALISE@
note:NEW
name:SWARUP
phone:567889
email:SWARUP@
note:CONTACT
Rolodex comands Insert(i),remove(R), Lookbyname(F),LookbyPhone number(N),Lookby
email(E)saves(S),save and quit(Q),printall(P),quit and dont save(X)
X

More Related Content

Similar to Python ProgramDo not use import please. Problem 1 Rolodex (Note .pdf

For this homework, you will write a program to create and manipulate.pdf
For this homework, you will write a program to create and manipulate.pdfFor this homework, you will write a program to create and manipulate.pdf
For this homework, you will write a program to create and manipulate.pdfherminaherman
 
Lecture 4 - Comm Lab: Web @ ITP
Lecture 4 - Comm Lab: Web @ ITPLecture 4 - Comm Lab: Web @ ITP
Lecture 4 - Comm Lab: Web @ ITPyucefmerhi
 
03.DS_Store__MACOSX03._.DS_Store03A2.DS_Store__.docx
03.DS_Store__MACOSX03._.DS_Store03A2.DS_Store__.docx03.DS_Store__MACOSX03._.DS_Store03A2.DS_Store__.docx
03.DS_Store__MACOSX03._.DS_Store03A2.DS_Store__.docxhoney725342
 
Suppose that you and I are friends on Facebook. and you want to figur.pdf
Suppose that you and I are friends on Facebook. and you want to figur.pdfSuppose that you and I are friends on Facebook. and you want to figur.pdf
Suppose that you and I are friends on Facebook. and you want to figur.pdfcallawaycorb73779
 
Beginner's Python Cheat Sheet.pdf
Beginner's Python Cheat Sheet.pdfBeginner's Python Cheat Sheet.pdf
Beginner's Python Cheat Sheet.pdfAkhileshKumar436707
 
Best of build 2021 - C# 10 & .NET 6
Best of build 2021 -  C# 10 & .NET 6Best of build 2021 -  C# 10 & .NET 6
Best of build 2021 - C# 10 & .NET 6Moaid Hathot
 
Not sure why my program wont run.Programmer S.Villegas helper N.pdf
Not sure why my program wont run.Programmer S.Villegas helper N.pdfNot sure why my program wont run.Programmer S.Villegas helper N.pdf
Not sure why my program wont run.Programmer S.Villegas helper N.pdfwasemanivytreenrco51
 
Real World Haskell: Lecture 7
Real World Haskell: Lecture 7Real World Haskell: Lecture 7
Real World Haskell: Lecture 7Bryan O'Sullivan
 
PLEASE MAKE SURE THE PROGRAM IS ASKING FOR INPUT FROM USER TO ADD OR.pdf
PLEASE MAKE SURE THE PROGRAM IS ASKING FOR INPUT FROM USER TO ADD OR.pdfPLEASE MAKE SURE THE PROGRAM IS ASKING FOR INPUT FROM USER TO ADD OR.pdf
PLEASE MAKE SURE THE PROGRAM IS ASKING FOR INPUT FROM USER TO ADD OR.pdfmallik3000
 
Assignment is Page 349-350 #4 and #5 Use the Linked Lis.pdf
Assignment is Page 349-350 #4 and #5 Use the Linked Lis.pdfAssignment is Page 349-350 #4 and #5 Use the Linked Lis.pdf
Assignment is Page 349-350 #4 and #5 Use the Linked Lis.pdfformicreation
 
Create a C program which auto-completes suggestions when beginning t.pdf
Create a C program which auto-completes suggestions when beginning t.pdfCreate a C program which auto-completes suggestions when beginning t.pdf
Create a C program which auto-completes suggestions when beginning t.pdffedosys
 
Clean code _v2003
 Clean code _v2003 Clean code _v2003
Clean code _v2003R696
 
Getting the following errorsError 1 error C2436 {ctor} mem.pdf
Getting the following errorsError 1 error C2436 {ctor}  mem.pdfGetting the following errorsError 1 error C2436 {ctor}  mem.pdf
Getting the following errorsError 1 error C2436 {ctor} mem.pdfherminaherman
 
I have the following code and I need to know why I am receiving the .pdf
I have the following code and I need to know why I am receiving the .pdfI have the following code and I need to know why I am receiving the .pdf
I have the following code and I need to know why I am receiving the .pdfezzi552
 
public static void main(String[], args) throws FileNotFoundExcepti.pdf
public static void main(String[], args) throws FileNotFoundExcepti.pdfpublic static void main(String[], args) throws FileNotFoundExcepti.pdf
public static void main(String[], args) throws FileNotFoundExcepti.pdffms12345
 
Solve using Java programming language- ----------------------------.pdf
Solve using Java programming language-   ----------------------------.pdfSolve using Java programming language-   ----------------------------.pdf
Solve using Java programming language- ----------------------------.pdfaksahnan
 
Step 1 The Pair Class Many times in writing software we come across p.pdf
Step 1 The Pair Class Many times in writing software we come across p.pdfStep 1 The Pair Class Many times in writing software we come across p.pdf
Step 1 The Pair Class Many times in writing software we come across p.pdfformaxekochi
 

Similar to Python ProgramDo not use import please. Problem 1 Rolodex (Note .pdf (20)

For this homework, you will write a program to create and manipulate.pdf
For this homework, you will write a program to create and manipulate.pdfFor this homework, you will write a program to create and manipulate.pdf
For this homework, you will write a program to create and manipulate.pdf
 
Lecture 4 - Comm Lab: Web @ ITP
Lecture 4 - Comm Lab: Web @ ITPLecture 4 - Comm Lab: Web @ ITP
Lecture 4 - Comm Lab: Web @ ITP
 
03.DS_Store__MACOSX03._.DS_Store03A2.DS_Store__.docx
03.DS_Store__MACOSX03._.DS_Store03A2.DS_Store__.docx03.DS_Store__MACOSX03._.DS_Store03A2.DS_Store__.docx
03.DS_Store__MACOSX03._.DS_Store03A2.DS_Store__.docx
 
Word games in c
Word games in cWord games in c
Word games in c
 
Suppose that you and I are friends on Facebook. and you want to figur.pdf
Suppose that you and I are friends on Facebook. and you want to figur.pdfSuppose that you and I are friends on Facebook. and you want to figur.pdf
Suppose that you and I are friends on Facebook. and you want to figur.pdf
 
Perl
PerlPerl
Perl
 
Beginner's Python Cheat Sheet.pdf
Beginner's Python Cheat Sheet.pdfBeginner's Python Cheat Sheet.pdf
Beginner's Python Cheat Sheet.pdf
 
Best of build 2021 - C# 10 & .NET 6
Best of build 2021 -  C# 10 & .NET 6Best of build 2021 -  C# 10 & .NET 6
Best of build 2021 - C# 10 & .NET 6
 
Not sure why my program wont run.Programmer S.Villegas helper N.pdf
Not sure why my program wont run.Programmer S.Villegas helper N.pdfNot sure why my program wont run.Programmer S.Villegas helper N.pdf
Not sure why my program wont run.Programmer S.Villegas helper N.pdf
 
Real World Haskell: Lecture 7
Real World Haskell: Lecture 7Real World Haskell: Lecture 7
Real World Haskell: Lecture 7
 
PLEASE MAKE SURE THE PROGRAM IS ASKING FOR INPUT FROM USER TO ADD OR.pdf
PLEASE MAKE SURE THE PROGRAM IS ASKING FOR INPUT FROM USER TO ADD OR.pdfPLEASE MAKE SURE THE PROGRAM IS ASKING FOR INPUT FROM USER TO ADD OR.pdf
PLEASE MAKE SURE THE PROGRAM IS ASKING FOR INPUT FROM USER TO ADD OR.pdf
 
Assignment is Page 349-350 #4 and #5 Use the Linked Lis.pdf
Assignment is Page 349-350 #4 and #5 Use the Linked Lis.pdfAssignment is Page 349-350 #4 and #5 Use the Linked Lis.pdf
Assignment is Page 349-350 #4 and #5 Use the Linked Lis.pdf
 
Create a C program which auto-completes suggestions when beginning t.pdf
Create a C program which auto-completes suggestions when beginning t.pdfCreate a C program which auto-completes suggestions when beginning t.pdf
Create a C program which auto-completes suggestions when beginning t.pdf
 
PostThis
PostThisPostThis
PostThis
 
Clean code _v2003
 Clean code _v2003 Clean code _v2003
Clean code _v2003
 
Getting the following errorsError 1 error C2436 {ctor} mem.pdf
Getting the following errorsError 1 error C2436 {ctor}  mem.pdfGetting the following errorsError 1 error C2436 {ctor}  mem.pdf
Getting the following errorsError 1 error C2436 {ctor} mem.pdf
 
I have the following code and I need to know why I am receiving the .pdf
I have the following code and I need to know why I am receiving the .pdfI have the following code and I need to know why I am receiving the .pdf
I have the following code and I need to know why I am receiving the .pdf
 
public static void main(String[], args) throws FileNotFoundExcepti.pdf
public static void main(String[], args) throws FileNotFoundExcepti.pdfpublic static void main(String[], args) throws FileNotFoundExcepti.pdf
public static void main(String[], args) throws FileNotFoundExcepti.pdf
 
Solve using Java programming language- ----------------------------.pdf
Solve using Java programming language-   ----------------------------.pdfSolve using Java programming language-   ----------------------------.pdf
Solve using Java programming language- ----------------------------.pdf
 
Step 1 The Pair Class Many times in writing software we come across p.pdf
Step 1 The Pair Class Many times in writing software we come across p.pdfStep 1 The Pair Class Many times in writing software we come across p.pdf
Step 1 The Pair Class Many times in writing software we come across p.pdf
 

More from fortmdu

How is a Decision Support Systems (DSS) different from a Management .pdf
How is a Decision Support Systems (DSS) different from a Management .pdfHow is a Decision Support Systems (DSS) different from a Management .pdf
How is a Decision Support Systems (DSS) different from a Management .pdffortmdu
 
I am trying to create a program That works with two other programs i.pdf
I am trying to create a program That works with two other programs i.pdfI am trying to create a program That works with two other programs i.pdf
I am trying to create a program That works with two other programs i.pdffortmdu
 
How does anti-malware software detect virusesWhat techniques are .pdf
How does anti-malware software detect virusesWhat techniques are .pdfHow does anti-malware software detect virusesWhat techniques are .pdf
How does anti-malware software detect virusesWhat techniques are .pdffortmdu
 
How can I upload a picture in here I tried with image properties ic.pdf
How can I upload a picture in here I tried with image properties ic.pdfHow can I upload a picture in here I tried with image properties ic.pdf
How can I upload a picture in here I tried with image properties ic.pdffortmdu
 
Explain the role of ATP in the action of Hsp70 and GroELES.Solu.pdf
Explain the role of ATP in the action of Hsp70 and GroELES.Solu.pdfExplain the role of ATP in the action of Hsp70 and GroELES.Solu.pdf
Explain the role of ATP in the action of Hsp70 and GroELES.Solu.pdffortmdu
 
Files Please respond to the following •Suppose you are creating.pdf
Files Please respond to the following •Suppose you are creating.pdfFiles Please respond to the following •Suppose you are creating.pdf
Files Please respond to the following •Suppose you are creating.pdffortmdu
 
evil_server.cpp#include string #include cstdlib #include.pdf
evil_server.cpp#include string #include cstdlib #include.pdfevil_server.cpp#include string #include cstdlib #include.pdf
evil_server.cpp#include string #include cstdlib #include.pdffortmdu
 
ecorrect Question 32 0 1 pts Referencing the diagram above, use the .pdf
ecorrect Question 32 0 1 pts Referencing the diagram above, use the .pdfecorrect Question 32 0 1 pts Referencing the diagram above, use the .pdf
ecorrect Question 32 0 1 pts Referencing the diagram above, use the .pdffortmdu
 
Disneys Expedition EverestOne of the newest thrill rides to open.pdf
Disneys Expedition EverestOne of the newest thrill rides to open.pdfDisneys Expedition EverestOne of the newest thrill rides to open.pdf
Disneys Expedition EverestOne of the newest thrill rides to open.pdffortmdu
 
Discuss ONE risk that a company faces when trying to diversify inte.pdf
Discuss ONE risk that a company faces when trying to diversify inte.pdfDiscuss ONE risk that a company faces when trying to diversify inte.pdf
Discuss ONE risk that a company faces when trying to diversify inte.pdffortmdu
 
Describe at least one reason why transitioning from PVST+ to Rapid P.pdf
Describe at least one reason why transitioning from PVST+ to Rapid P.pdfDescribe at least one reason why transitioning from PVST+ to Rapid P.pdf
Describe at least one reason why transitioning from PVST+ to Rapid P.pdffortmdu
 
CASE 2-1 BUILDING UP OUR ASSETS DHR CONSTRUCTIONIn August 2011, w.pdf
CASE 2-1 BUILDING UP OUR ASSETS DHR CONSTRUCTIONIn August 2011, w.pdfCASE 2-1 BUILDING UP OUR ASSETS DHR CONSTRUCTIONIn August 2011, w.pdf
CASE 2-1 BUILDING UP OUR ASSETS DHR CONSTRUCTIONIn August 2011, w.pdffortmdu
 
C++ Write a function that takes two numbers are parameters and retu.pdf
C++ Write a function that takes two numbers are parameters and retu.pdfC++ Write a function that takes two numbers are parameters and retu.pdf
C++ Write a function that takes two numbers are parameters and retu.pdffortmdu
 
B.1 Reaction of a Hydrate Addition of Water (2) Appearance Heating (1.pdf
B.1 Reaction of a Hydrate Addition of Water (2) Appearance Heating (1.pdfB.1 Reaction of a Hydrate Addition of Water (2) Appearance Heating (1.pdf
B.1 Reaction of a Hydrate Addition of Water (2) Appearance Heating (1.pdffortmdu
 
Assignment isPage 349-350 #4 and #5 Use the Linked List lab.pdf
Assignment isPage 349-350 #4 and #5 Use the Linked List lab.pdfAssignment isPage 349-350 #4 and #5 Use the Linked List lab.pdf
Assignment isPage 349-350 #4 and #5 Use the Linked List lab.pdffortmdu
 
You maintain several virtual machines (VMs) in an offline state. How.pdf
You maintain several virtual machines (VMs) in an offline state. How.pdfYou maintain several virtual machines (VMs) in an offline state. How.pdf
You maintain several virtual machines (VMs) in an offline state. How.pdffortmdu
 
Which of the following statements is not TRUE1)For a 64-bit compute.pdf
Which of the following statements is not TRUE1)For a 64-bit compute.pdfWhich of the following statements is not TRUE1)For a 64-bit compute.pdf
Which of the following statements is not TRUE1)For a 64-bit compute.pdffortmdu
 
You are running an ELISA on a sample to test for the presence of .pdf
You are running an ELISA on a sample to test for the presence of .pdfYou are running an ELISA on a sample to test for the presence of .pdf
You are running an ELISA on a sample to test for the presence of .pdffortmdu
 
You are to write an efficient program that will read a dictionary of.pdf
You are to write an efficient program that will read a dictionary of.pdfYou are to write an efficient program that will read a dictionary of.pdf
You are to write an efficient program that will read a dictionary of.pdffortmdu
 
X = C B - B C D; Use Accumulator Register-Register (LoadSt.pdf
X = C B - B  C  D; Use Accumulator  Register-Register (LoadSt.pdfX = C B - B  C  D; Use Accumulator  Register-Register (LoadSt.pdf
X = C B - B C D; Use Accumulator Register-Register (LoadSt.pdffortmdu
 

More from fortmdu (20)

How is a Decision Support Systems (DSS) different from a Management .pdf
How is a Decision Support Systems (DSS) different from a Management .pdfHow is a Decision Support Systems (DSS) different from a Management .pdf
How is a Decision Support Systems (DSS) different from a Management .pdf
 
I am trying to create a program That works with two other programs i.pdf
I am trying to create a program That works with two other programs i.pdfI am trying to create a program That works with two other programs i.pdf
I am trying to create a program That works with two other programs i.pdf
 
How does anti-malware software detect virusesWhat techniques are .pdf
How does anti-malware software detect virusesWhat techniques are .pdfHow does anti-malware software detect virusesWhat techniques are .pdf
How does anti-malware software detect virusesWhat techniques are .pdf
 
How can I upload a picture in here I tried with image properties ic.pdf
How can I upload a picture in here I tried with image properties ic.pdfHow can I upload a picture in here I tried with image properties ic.pdf
How can I upload a picture in here I tried with image properties ic.pdf
 
Explain the role of ATP in the action of Hsp70 and GroELES.Solu.pdf
Explain the role of ATP in the action of Hsp70 and GroELES.Solu.pdfExplain the role of ATP in the action of Hsp70 and GroELES.Solu.pdf
Explain the role of ATP in the action of Hsp70 and GroELES.Solu.pdf
 
Files Please respond to the following •Suppose you are creating.pdf
Files Please respond to the following •Suppose you are creating.pdfFiles Please respond to the following •Suppose you are creating.pdf
Files Please respond to the following •Suppose you are creating.pdf
 
evil_server.cpp#include string #include cstdlib #include.pdf
evil_server.cpp#include string #include cstdlib #include.pdfevil_server.cpp#include string #include cstdlib #include.pdf
evil_server.cpp#include string #include cstdlib #include.pdf
 
ecorrect Question 32 0 1 pts Referencing the diagram above, use the .pdf
ecorrect Question 32 0 1 pts Referencing the diagram above, use the .pdfecorrect Question 32 0 1 pts Referencing the diagram above, use the .pdf
ecorrect Question 32 0 1 pts Referencing the diagram above, use the .pdf
 
Disneys Expedition EverestOne of the newest thrill rides to open.pdf
Disneys Expedition EverestOne of the newest thrill rides to open.pdfDisneys Expedition EverestOne of the newest thrill rides to open.pdf
Disneys Expedition EverestOne of the newest thrill rides to open.pdf
 
Discuss ONE risk that a company faces when trying to diversify inte.pdf
Discuss ONE risk that a company faces when trying to diversify inte.pdfDiscuss ONE risk that a company faces when trying to diversify inte.pdf
Discuss ONE risk that a company faces when trying to diversify inte.pdf
 
Describe at least one reason why transitioning from PVST+ to Rapid P.pdf
Describe at least one reason why transitioning from PVST+ to Rapid P.pdfDescribe at least one reason why transitioning from PVST+ to Rapid P.pdf
Describe at least one reason why transitioning from PVST+ to Rapid P.pdf
 
CASE 2-1 BUILDING UP OUR ASSETS DHR CONSTRUCTIONIn August 2011, w.pdf
CASE 2-1 BUILDING UP OUR ASSETS DHR CONSTRUCTIONIn August 2011, w.pdfCASE 2-1 BUILDING UP OUR ASSETS DHR CONSTRUCTIONIn August 2011, w.pdf
CASE 2-1 BUILDING UP OUR ASSETS DHR CONSTRUCTIONIn August 2011, w.pdf
 
C++ Write a function that takes two numbers are parameters and retu.pdf
C++ Write a function that takes two numbers are parameters and retu.pdfC++ Write a function that takes two numbers are parameters and retu.pdf
C++ Write a function that takes two numbers are parameters and retu.pdf
 
B.1 Reaction of a Hydrate Addition of Water (2) Appearance Heating (1.pdf
B.1 Reaction of a Hydrate Addition of Water (2) Appearance Heating (1.pdfB.1 Reaction of a Hydrate Addition of Water (2) Appearance Heating (1.pdf
B.1 Reaction of a Hydrate Addition of Water (2) Appearance Heating (1.pdf
 
Assignment isPage 349-350 #4 and #5 Use the Linked List lab.pdf
Assignment isPage 349-350 #4 and #5 Use the Linked List lab.pdfAssignment isPage 349-350 #4 and #5 Use the Linked List lab.pdf
Assignment isPage 349-350 #4 and #5 Use the Linked List lab.pdf
 
You maintain several virtual machines (VMs) in an offline state. How.pdf
You maintain several virtual machines (VMs) in an offline state. How.pdfYou maintain several virtual machines (VMs) in an offline state. How.pdf
You maintain several virtual machines (VMs) in an offline state. How.pdf
 
Which of the following statements is not TRUE1)For a 64-bit compute.pdf
Which of the following statements is not TRUE1)For a 64-bit compute.pdfWhich of the following statements is not TRUE1)For a 64-bit compute.pdf
Which of the following statements is not TRUE1)For a 64-bit compute.pdf
 
You are running an ELISA on a sample to test for the presence of .pdf
You are running an ELISA on a sample to test for the presence of .pdfYou are running an ELISA on a sample to test for the presence of .pdf
You are running an ELISA on a sample to test for the presence of .pdf
 
You are to write an efficient program that will read a dictionary of.pdf
You are to write an efficient program that will read a dictionary of.pdfYou are to write an efficient program that will read a dictionary of.pdf
You are to write an efficient program that will read a dictionary of.pdf
 
X = C B - B C D; Use Accumulator Register-Register (LoadSt.pdf
X = C B - B  C  D; Use Accumulator  Register-Register (LoadSt.pdfX = C B - B  C  D; Use Accumulator  Register-Register (LoadSt.pdf
X = C B - B C D; Use Accumulator Register-Register (LoadSt.pdf
 

Recently uploaded

Danh sách HSG Bộ môn cấp trường - Cấp THPT.pdf
Danh sách HSG Bộ môn cấp trường - Cấp THPT.pdfDanh sách HSG Bộ môn cấp trường - Cấp THPT.pdf
Danh sách HSG Bộ môn cấp trường - Cấp THPT.pdfQucHHunhnh
 
The Benefits and Challenges of Open Educational Resources
The Benefits and Challenges of Open Educational ResourcesThe Benefits and Challenges of Open Educational Resources
The Benefits and Challenges of Open Educational Resourcesaileywriter
 
Morse OER Some Benefits and Challenges.pptx
Morse OER Some Benefits and Challenges.pptxMorse OER Some Benefits and Challenges.pptx
Morse OER Some Benefits and Challenges.pptxjmorse8
 
[GDSC YCCE] Build with AI Online Presentation
[GDSC YCCE] Build with AI Online Presentation[GDSC YCCE] Build with AI Online Presentation
[GDSC YCCE] Build with AI Online PresentationGDSCYCCE
 
slides CapTechTalks Webinar May 2024 Alexander Perry.pptx
slides CapTechTalks Webinar May 2024 Alexander Perry.pptxslides CapTechTalks Webinar May 2024 Alexander Perry.pptx
slides CapTechTalks Webinar May 2024 Alexander Perry.pptxCapitolTechU
 
Industrial Training Report- AKTU Industrial Training Report
Industrial Training Report- AKTU Industrial Training ReportIndustrial Training Report- AKTU Industrial Training Report
Industrial Training Report- AKTU Industrial Training ReportAvinash Rai
 
The impact of social media on mental health and well-being has been a topic o...
The impact of social media on mental health and well-being has been a topic o...The impact of social media on mental health and well-being has been a topic o...
The impact of social media on mental health and well-being has been a topic o...sanghavirahi2
 
Telling Your Story_ Simple Steps to Build Your Nonprofit's Brand Webinar.pdf
Telling Your Story_ Simple Steps to Build Your Nonprofit's Brand Webinar.pdfTelling Your Story_ Simple Steps to Build Your Nonprofit's Brand Webinar.pdf
Telling Your Story_ Simple Steps to Build Your Nonprofit's Brand Webinar.pdfTechSoup
 
Basic Civil Engg Notes_Chapter-6_Environment Pollution & Engineering
Basic Civil Engg Notes_Chapter-6_Environment Pollution & EngineeringBasic Civil Engg Notes_Chapter-6_Environment Pollution & Engineering
Basic Civil Engg Notes_Chapter-6_Environment Pollution & EngineeringDenish Jangid
 
How to Manage Notification Preferences in the Odoo 17
How to Manage Notification Preferences in the Odoo 17How to Manage Notification Preferences in the Odoo 17
How to Manage Notification Preferences in the Odoo 17Celine George
 
How to Create Map Views in the Odoo 17 ERP
How to Create Map Views in the Odoo 17 ERPHow to Create Map Views in the Odoo 17 ERP
How to Create Map Views in the Odoo 17 ERPCeline George
 
Research Methods in Psychology | Cambridge AS Level | Cambridge Assessment In...
Research Methods in Psychology | Cambridge AS Level | Cambridge Assessment In...Research Methods in Psychology | Cambridge AS Level | Cambridge Assessment In...
Research Methods in Psychology | Cambridge AS Level | Cambridge Assessment In...Abhinav Gaur Kaptaan
 
How to Split Bills in the Odoo 17 POS Module
How to Split Bills in the Odoo 17 POS ModuleHow to Split Bills in the Odoo 17 POS Module
How to Split Bills in the Odoo 17 POS ModuleCeline George
 
Keeping Your Information Safe with Centralized Security Services
Keeping Your Information Safe with Centralized Security ServicesKeeping Your Information Safe with Centralized Security Services
Keeping Your Information Safe with Centralized Security ServicesTechSoup
 
Open Educational Resources Primer PowerPoint
Open Educational Resources Primer PowerPointOpen Educational Resources Primer PowerPoint
Open Educational Resources Primer PowerPointELaRue0
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345beazzy04
 
Benefits and Challenges of Using Open Educational Resources
Benefits and Challenges of Using Open Educational ResourcesBenefits and Challenges of Using Open Educational Resources
Benefits and Challenges of Using Open Educational Resourcesdimpy50
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaasiemaillard
 

Recently uploaded (20)

Danh sách HSG Bộ môn cấp trường - Cấp THPT.pdf
Danh sách HSG Bộ môn cấp trường - Cấp THPT.pdfDanh sách HSG Bộ môn cấp trường - Cấp THPT.pdf
Danh sách HSG Bộ môn cấp trường - Cấp THPT.pdf
 
The Benefits and Challenges of Open Educational Resources
The Benefits and Challenges of Open Educational ResourcesThe Benefits and Challenges of Open Educational Resources
The Benefits and Challenges of Open Educational Resources
 
Morse OER Some Benefits and Challenges.pptx
Morse OER Some Benefits and Challenges.pptxMorse OER Some Benefits and Challenges.pptx
Morse OER Some Benefits and Challenges.pptx
 
Introduction to Quality Improvement Essentials
Introduction to Quality Improvement EssentialsIntroduction to Quality Improvement Essentials
Introduction to Quality Improvement Essentials
 
[GDSC YCCE] Build with AI Online Presentation
[GDSC YCCE] Build with AI Online Presentation[GDSC YCCE] Build with AI Online Presentation
[GDSC YCCE] Build with AI Online Presentation
 
slides CapTechTalks Webinar May 2024 Alexander Perry.pptx
slides CapTechTalks Webinar May 2024 Alexander Perry.pptxslides CapTechTalks Webinar May 2024 Alexander Perry.pptx
slides CapTechTalks Webinar May 2024 Alexander Perry.pptx
 
Industrial Training Report- AKTU Industrial Training Report
Industrial Training Report- AKTU Industrial Training ReportIndustrial Training Report- AKTU Industrial Training Report
Industrial Training Report- AKTU Industrial Training Report
 
The impact of social media on mental health and well-being has been a topic o...
The impact of social media on mental health and well-being has been a topic o...The impact of social media on mental health and well-being has been a topic o...
The impact of social media on mental health and well-being has been a topic o...
 
Telling Your Story_ Simple Steps to Build Your Nonprofit's Brand Webinar.pdf
Telling Your Story_ Simple Steps to Build Your Nonprofit's Brand Webinar.pdfTelling Your Story_ Simple Steps to Build Your Nonprofit's Brand Webinar.pdf
Telling Your Story_ Simple Steps to Build Your Nonprofit's Brand Webinar.pdf
 
Basic Civil Engg Notes_Chapter-6_Environment Pollution & Engineering
Basic Civil Engg Notes_Chapter-6_Environment Pollution & EngineeringBasic Civil Engg Notes_Chapter-6_Environment Pollution & Engineering
Basic Civil Engg Notes_Chapter-6_Environment Pollution & Engineering
 
How to Manage Notification Preferences in the Odoo 17
How to Manage Notification Preferences in the Odoo 17How to Manage Notification Preferences in the Odoo 17
How to Manage Notification Preferences in the Odoo 17
 
How to Create Map Views in the Odoo 17 ERP
How to Create Map Views in the Odoo 17 ERPHow to Create Map Views in the Odoo 17 ERP
How to Create Map Views in the Odoo 17 ERP
 
Research Methods in Psychology | Cambridge AS Level | Cambridge Assessment In...
Research Methods in Psychology | Cambridge AS Level | Cambridge Assessment In...Research Methods in Psychology | Cambridge AS Level | Cambridge Assessment In...
Research Methods in Psychology | Cambridge AS Level | Cambridge Assessment In...
 
How to Split Bills in the Odoo 17 POS Module
How to Split Bills in the Odoo 17 POS ModuleHow to Split Bills in the Odoo 17 POS Module
How to Split Bills in the Odoo 17 POS Module
 
Mattingly "AI & Prompt Design: Limitations and Solutions with LLMs"
Mattingly "AI & Prompt Design: Limitations and Solutions with LLMs"Mattingly "AI & Prompt Design: Limitations and Solutions with LLMs"
Mattingly "AI & Prompt Design: Limitations and Solutions with LLMs"
 
Keeping Your Information Safe with Centralized Security Services
Keeping Your Information Safe with Centralized Security ServicesKeeping Your Information Safe with Centralized Security Services
Keeping Your Information Safe with Centralized Security Services
 
Open Educational Resources Primer PowerPoint
Open Educational Resources Primer PowerPointOpen Educational Resources Primer PowerPoint
Open Educational Resources Primer PowerPoint
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
 
Benefits and Challenges of Using Open Educational Resources
Benefits and Challenges of Using Open Educational ResourcesBenefits and Challenges of Using Open Educational Resources
Benefits and Challenges of Using Open Educational Resources
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 

Python ProgramDo not use import please. Problem 1 Rolodex (Note .pdf

  • 1. Python Program Do not use import please. Problem 1: Rolodex (Note: A Rolodex is a Contact List) Write a program that manages a rolodex. This program prompts the user for the name of a rol file. This program should be able to load any rol file and require that the file extension -i.e the last 4 letters of the file be rol. The file rol is consider a valid file. If the file exists the program loads in the contacts stored in the file. A Rolodex contains unique individuals, no duplicate names are allowed. However, name lookups are case sensitive, so "Apple" and "apple" are considered different names allowed However, name Solution Rolodex.java public class Rolodex{ String name; String phone; String email; String note; Rolodex(String name,String phone,String email,String note){ this.name=name; this.phone=phone; this.email=email; this.note=note; } public String tostring(){ return "name:"+name+" phone:"+phone +" email:"+email+ " note:"+note; } } rolodexmain.java import java.util.*; public class rolodexmain { static Scanner sc=new Scanner(System.in); static Listlist=new ArrayList();
  • 2. static Setsets=new HashSet(); public static void main(String[] args) { // TODO Auto-generated method stub while(true){ System.out.println("Rolodex comands t Insert(i),remove(R), Lookbyname(F),LookbyPhone number(N),Lookby email(E)saves(S),save and quit(Q),printall(P),quit and dont save(X)"); char ch=sc.next().charAt(0); switch(ch){ case 'I': insert(list); break; case 'R': deleted(list); break; case 'F': Lookbyname(list); break; case 'N': Lookbyphonenumber(list); break; case 'E': Lookbyemail(list); break; case 'P': printall(list); break; case 'X':
  • 3. System.exit(0); case 'S': saves(list); break; case 'Q': savesandquit(list); System.exit(0); } } } public static void insert(List list){ System.out.println("please enter contact name:"); String name=sc.next(); System.out.println("please enter contact phone number:"); String phone=sc.next(); System.out.println("please enter contact email id:"); String email=sc.next(); System.out.println("please enter contact note:"); String note=sc.next(); Rolodex r=new Rolodex(name,phone,email,note); list.add(r); } public static void deleted(List list){ boolean flag=false; System.out.println("enter name of contact to delete :"); String dname=sc.next(); for(int i=0;i list){
  • 4. System.out.println("enter name of contact which you want to look :"); String lname=sc.next(); for(int i=0;i list){ System.out.println("please enter phone number which you want to look:"); String lphone=sc.next(); for(int i=0;i list){ System.out.println("please enter phone number which you want to look:"); String lemail=sc.next(); for(int i=0;i list){ for(int i=0;i list){ sets.addAll(list); for (Rolodex o : sets) { // Rolodex r=(Rolodex)sets; System.out.println(o.tostring()); } } public static void savesandquit(List list){ sets.addAll(list); for (Rolodex o : sets) { // Rolodex r=(Rolodex)sets; System.out.println(o.tostring()); } } } output: Rolodex comands Insert(i),remove(R), Lookbyname(F),LookbyPhone number(N),Lookby email(E)saves(S),save and quit(Q),printall(P),quit and dont save(X) I please enter contact name:
  • 5. SWARUP please enter contact phone number: 567889 please enter contact email id: SWARUP@ please enter contact note: CONTACT Rolodex comands Insert(i),remove(R), Lookbyname(F),LookbyPhone number(N),Lookby email(E)saves(S),save and quit(Q),printall(P),quit and dont save(X) I please enter contact name: ALISA please enter contact phone number: 123 please enter contact email id: ALISE@ please enter contact note: NEW Rolodex comands Insert(i),remove(R), Lookbyname(F),LookbyPhone number(N),Lookby email(E)saves(S),save and quit(Q),printall(P),quit and dont save(X) F enter name of contact which you want to look : SWARUP name:SWARUP phone:567889 email:SWARUP@ note:CONTACT Rolodex comands Insert(i),remove(R), Lookbyname(F),LookbyPhone number(N),Lookby email(E)saves(S),save and quit(Q),printall(P),quit and dont save(X) N please enter phone number which you want to look: 567889 name:SWARUP phone:567889 email:SWARUP@ note:CONTACT
  • 6. Rolodex comands Insert(i),remove(R), Lookbyname(F),LookbyPhone number(N),Lookby email(E)saves(S),save and quit(Q),printall(P),quit and dont save(X) E please enter phone number which you want to look: ALISE@ name:ALISA phone:123 email:ALISE@ note:NEW Rolodex comands Insert(i),remove(R), Lookbyname(F),LookbyPhone number(N),Lookby email(E)saves(S),save and quit(Q),printall(P),quit and dont save(X) P name:SWARUP phone:567889 email:SWARUP@ note:CONTACT name:ALISA phone:123 email:ALISE@ note:NEW Rolodex comands Insert(i),remove(R), Lookbyname(F),LookbyPhone number(N),Lookby email(E)saves(S),save and quit(Q),printall(P),quit and dont save(X) S name:ALISA phone:123 email:ALISE@ note:NEW name:SWARUP phone:567889 email:SWARUP@ note:CONTACT Rolodex comands Insert(i),remove(R), Lookbyname(F),LookbyPhone number(N),Lookby email(E)saves(S),save and quit(Q),printall(P),quit and dont save(X) X