Solved by verified expert:I uploaded a code in the files sections, and I need you to answer the questions that I uploaded from the code that I gave you. please make the answers in a word document file.
the_question_that_need_to_be_aswered_from_the_solution.txt
the_solution_code.pdf
Unformatted Attachment Preview
2 points – Does the solution produce the correct output? If no, be specific as to what is incorrect.
2 points – Identify two ways in which comments can be used more effectively. Be specific. (1 point each)
2 points – Identify two ways in which the Python code can be made more concise. Be specific. (1 point each)
2 points – Other than by adding comments, identify two ways in which the Python code can be made more understandable. Be specific. (1 point each)
2 points – What are two unique strengths of the solution? Explain and be specific. (1 point each)11/4/2017
#
#
#
#
#
#
#
#
https://www.cs.montana.edu/paxton/classes/csci127/inlabs/lab10/program4.py
————————————————CSCI 127, Joy and Beauty of Data
Program 4: Advising System
Last Modified: October 31, 2017
————————————————This is to check on Student status and to update Studeny to resources
that is for there Major.
————————————————-
## This Class holds Generic info to be tested and printed
class Generic_Major:
def __init__(self, firstName, lastName):
self.firstName = firstName.title()
self.lastName = lastName.title()
self.major = “Generic”
self.major_troubles = False
self.math_troubles = False
def get_first_name(self):
return self.firstName
def get_last_name(self):
return self.lastName
def get_major(self):
return self.major
def get_major_troubles(self):
return self.major_troubles
def get_math_troubles(self):
return self.math_troubles
def major_advising(self):
if self.major_troubles:
print(“because you are having troubles with your major:”)
print(“–> visit your professor during office hours”)
print(“–> visit your academic advisor”)
def math_advising(self):
if self.math_troubles:
print(“because you are having troubles with math:”)
print(“–> visit the Math Learning Center in Wilson 1-112”)
def set_major_troubles(self, x):
self.major_troubles = x
def set_math_troubles(self, x):
self.math_troubles = x
## This is all the Sub-Class to test and print for selected Majors
class CLS_Major(Generic_Major):
def __init__(self, firstName, lastName):
Generic_Major.__init__(self, firstName, lastName)
self.major = “College of Letters and Sciences”
class COE_Major(Generic_Major):
def __init__(self, firstName, lastName):
Generic_Major.__init__(self, firstName, lastName)
self.major = “College of Engineering”
def major_advising(self):
if self.major_troubles:
print(“–> visit the EMPower Student Center in Roberts 313”)
https://www.cs.montana.edu/paxton/classes/csci127/inlabs/lab10/program4.py
1/3
11/4/2017
https://www.cs.montana.edu/paxton/classes/csci127/inlabs/lab10/program4.py
Generic_Major.major_advising(self)
class Computer_Engineering_Major(Generic_Major):
def __init__(self, firstName, lastName):
Generic_Major.__init__(self, firstName, lastName)
self.major = “Computer Engineering”
def major_advising(self):
if self.major_troubles:
print(“–> visit the EMPower Student Center in Roberts 313”)
Generic_Major.major_advising(self)
class Physics_Major(Generic_Major):
def __init__(self, firstName, lastName):
Generic_Major.__init__(self, firstName, lastName)
self.major = “Physics”
def major_advising(self):
if self.major_troubles:
print(“–> visit the Physics Learning Center in Barnard Hall 230”)
Generic_Major.major_advising(self)
class Computer_Science_Major(Generic_Major):
def __init__(self, firstName, lastName):
Generic_Major.__init__(self, firstName, lastName)
self.major = “Computer Science”
def major_advising(self):
if self.major_troubles:
print(“–> visit the CS Student Success Center in Barnard Hall 259”)
print(“–> visit a CS professional advisor in Barnard Hall 357″)
print(“–> visit the EMPower Student Center in Roberts 313”)
Generic_Major.major_advising(self)
# ————————————————# Do not change anything below this line
# ————————————————def advise(student):
print(“Student:”, student.get_first_name(), student.get_last_name())
print(“Major: ” + student.get_major() + “, Major Troubles: ” +
str(student.get_major_troubles()) + “, Math Troubles: ” +
str(student.get_math_troubles()))
print()
if not student.get_math_troubles() and not student.get_major_troubles():
print(“No advising is necessary. Keep up the good work!”)
else:
student.major_advising()
student.math_advising()
print(“——————————“)
# ————————————————def process(student):
advise(student)
student.set_major_troubles(True)
student.set_math_troubles(True)
advise(student)
# ————————————————def main():
# Every student has a major, even if it is “undeclared”
msu_student = Generic_Major(“jalen”, “nelson”)
process(msu_student)
https://www.cs.montana.edu/paxton/classes/csci127/inlabs/lab10/program4.py
2/3
11/4/2017
https://www.cs.montana.edu/paxton/classes/csci127/inlabs/lab10/program4.py
msu_student.set_math_troubles(False)
advise(msu_student)
msu_student.set_math_troubles(True)
msu_student.set_major_troubles(False)
advise(msu_student)
# A CLS (College of Letters and Science) major is a subclass of a Generic major
msu_student = CLS_Major(“emma”, “phillips”)
process(msu_student)
# A COE (College of Engineering) major is a subclass of a Generic major
msu_student = COE_Major(“camden”, “miller”)
process(msu_student)
# A Computer Engineering major is a subclass of a COE major
msu_student = Computer_Engineering_Major(“gabriel”, “smith”)
process(msu_student)
# A Physics major is a subclass of a CLS major
msu_student = Physics_Major(“lena”, “hamilton”)
process(msu_student)
# A Computer Science major is a subclass of a COE major
msu_student = Computer_Science_Major(“halley”, “jones”)
process(msu_student)
msu_student.set_math_troubles(False)
advise(msu_student)
msu_student.set_math_troubles(True)
msu_student.set_major_troubles(False)
advise(msu_student)
# ————————————————main()
https://www.cs.montana.edu/paxton/classes/csci127/inlabs/lab10/program4.py
3/3
…
Purchase answer to see full
attachment
You will get a plagiarism-free paper and you can get an originality report upon request.
All the personal information is confidential and we have 100% safe payment methods. We also guarantee good grades
Delivering a high-quality product at a reasonable price is not enough anymore.
That’s why we have developed 5 beneficial guarantees that will make your experience with our service enjoyable, easy, and safe.
You have to be 100% sure of the quality of your product to give a money-back guarantee. This describes us perfectly. Make sure that this guarantee is totally transparent.
Read moreEach paper is composed from scratch, according to your instructions. It is then checked by our plagiarism-detection software. There is no gap where plagiarism could squeeze in.
Read moreThanks to our free revisions, there is no way for you to be unsatisfied. We will work on your paper until you are completely happy with the result.
Read moreYour email is safe, as we store it according to international data protection rules. Your bank details are secure, as we use only reliable payment systems.
Read moreBy sending us your money, you buy the service we provide. Check out our terms and conditions if you prefer business talks to be laid out in official language.
Read more