Using python, write code for problem. The file JusticesDict.dat is used for this
ID: 3849784 • Letter: U
Question
Using python, write code for problem. The file JusticesDict.dat is used for this problem and i have uploaded that file to my google drive and shared the link here, since there is no option to upload the file here. Please also put screenshot of your code.
The file is in .dat format so i am not able to share it through google docs like you had asked for. I have also uploaded it to dropbox and i can share the link to you as follows:
https://www.dropbox.com/s/vvba59d7pongtxs/JusticesDict.dat?dl=0
The file is actually encrypted and given to us directly by our professor for the assignment. So i have shared the file to you exactly how it was given to us. Please try downloading it and help me with this question. Thanks.
JusticesDict.dat file
https://drive.google.com/file/d/0B1GZQvpTojdPR2FOejFlQXY5a1E/view?usp=sharing
In Exercises 51 through 54, use the file JusticesDict.dat that stores a dictionary contain- ing data about the Supreme Court justices, past and present. Each item of the dictionary has the form "name of justice:data dictionary" The data dictionary for a justice contains their appointing president, the state from which they were appointed, the year appointed, and the year they left the court. (For current justices, the year they left the court is set to 0.) Three items from the dictionary are as follows: Earl Warren ('pres Dwight Eisenhower yrLeft' :1969, 'yrAppt' 1953 state CA') Sonia Sotomayor Press Barack Obama 'yrLeft' 0, yrAppt. 2009 state NY') Salmon Chase yrAppt 1864, 'pres Abraham Lincoln state OH 'yrLeft' 1873)Explanation / Answer
class Employee:
'ID, number, department, job title'
def __init__(self,ID,number,department,job_title):
self.ID = ID
self.number = number
self.department = department
self.job_title = job_title
def set_ID(self,ID):
self.ID = ID
def set_number(self,number):
self.number = number
def set_department(self,department):
self.department = department
def job_title(self,job_title):
self.job_title = job_title
def get_ID(self):
return self.ID
def get_number(self):
return self.number
def get_department(self):
return self.department
def get_job_title(self):
return self.job_title
def get_data(self):
print self.ID, self.number,self.department,self.job_title
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.