Fill This Form To Receive Instant Help

Help in Homework
trustpilot ratings
google ratings


Homework answers / question archive / Solve the following problem: #5

Solve the following problem: #5

Computer Science

Solve the following problem: #5. Recursive List Sum (page 594) There is a similar program on page 585 (range_sum function). Use comments and good variable names. Save your Python script as Lab9.py The program must be tested for full credit and then uploaded onto Canvas. Solve the following problems: #2. Shift Supervisor Class (page 575) -- 35 points Must submit also the Employee class along with the application. Both classes can be in the same file. #4. Largest List Item. (page 594) -- 30 points Without recursion the program will receive very little credit. #4. Celsius to Fahrenheit (page 655) -- 35 points Extra credit 30 points for the same program (same GUI form) to perform also Fahrenheit to Celsius conversion. For the extra credit, use the same text boxes with one additional button. Save and submit you files as Proj5_prob1.py (along with the class file), Proj5_prob2.py and Proj5_Prob3.py respectively. Use good variable names, comments and code layout. Reminder: in Canvas every new submission will completely erase the previous one. Question 1 2 pts Accessor methods are also known as setters getters instances attributes Question 2 2 pts Which of the following does not apply to sets? The stored elements can be of different data types. All the elements must be unique; you cannot have two elements with the same value. The elements are unordered. The elements are in pairs. Question 3 2 pts The procedures that an object performs are called methods actions modules instances Question 4 2 pts What is the special name given to the method that returns a string containing an object's state? O __state__ __obj_. O __str_- O __init__ Question 5 2 pts What type of method provides a safe way for code outside a class to retrieve the values of attributes, without exposing the attributes in a way that could allow them to be changed by code outside the method? accessor mutator setter class Question 6 2 pts Which method would you use to get the value associated with a specific key and remove that key-value pair from the dictionary? list items pop O popitem Question 7 2 pts Combining data and code in a single object is known as modularity O instantiation encapsulation objectification Question 8 2 pts Which method is automatically called when you pass an object as an argument to the print function? state __obj__ _str__ _init__. Question 9 2 pts What is the correct structure to create a dictionary of months where each month will be accessed by its month number (for example, January is month 1, April is month 4)? O {1;'January', 2 ; 'February, ... 12 ; 'December'} O {1 : 'January', 2 : 'February', ... 12: 'December'} O ['1': 'January', '2': 'February, ... 12': 'December'] O { 1, 2,... 12 : 'January', 'February',... 'December"} Question 10 2 pts What does the get method do if the specified key is not found in the dictionary? o It throws an exception. o It does nothing. O It returns a default value. O You cannot use the get method to specify a key. Question 11 2 pts What does the acronym UML stand for? Unified Modeling Language United Modeling Language Unified Model Language Union of Modeling Languages Question 12 2 pts Which of the following will create an object, worker_joey, of the Worker class? def__init__(worker_joey): class worker_joey: worker_joey = Worker() worker_joey. Worker Question 13 2 pts When an object is passed as an argument, is passed into the parameter variable. a copy of the object a reference to the object's state a reference to the object Objects cannot be passed as arguments. Question 14 2 pts Which attributes belong to a specific instance of a class? instance self object data Question 15 2 pts What is the value of the variable phones after the following code executes? phones = {'John': '5555555', 'Julie': '5557777'} phones['John'] = '5556666' {'John':'5555555', 'Julie': '5557777'} O {'John': 56666, 'Julie': '5. 7777'} {'John': '5556666'} This code is invalid. Question 16 2 pts What will be the result of the following code? ages = {'Aaron': 6, 'Kelly': 3, 'Abigail': 1} value = ages['Brianna'] False 0 -1 KeyError Question 17 2 pts Which would you use to delete an existing key-value pair from a dictionary? del remove delete unpair Question 18 2 pts Which section in the UML holds the list of the class's methods? first section second section third section fourth section Question 19 2 pts What will be displayed after the following code executes? (Note: the order of the display of entries in a dictionary are not in a specific order.) cities = {'GA': 'Atlanta', 'NY' : 'Albany', 'CA': 'San Diego'} if 'CA' in cities: del cities['CA'] cities['CA'] = 'Sacramento' print(cities) O {'CA': 'Sacramento'} O ['CA': 'Sacramento'] O {'NY': 'Albany', 'GA': 'Atlanta'} O {'CA': 'Sacramento', 'NY': 'Albany' , 'GA': 'Atlanta'} Question 20 2 pts What is the process used to convert an object to a stream of bytes that can be saved in a file? pickling streaming writing dumping Question 21 2 pts Which of the following can be thought of as a self-contained unit that consists of data attributes and the methods that operate on the data attributes? a class an object an instance a module Question 22 2 pts Which is the first line needed when creating a class named Worker? def__init__(self): class Worker: import random def worker_pay(self): Question 23 2 pts What will be displayed after the following code executes? (Note: the order of the display of entries in a dictionary are not in a specific order.) cities = {'GA': 'Atlanta' , 'NY': 'Albany', 'CA': 'San Diego'} if 'FL' in cities: del cities['FL'] cities['FL'] = 'Tallahassee' print(cities) {'FL': 'Tallahassee'} KeyError O {'GA': 'Atlanta', 'FL': 'Tallahassee, 'NY': 'Albany, 'CA': 'San Diego'} O {'CA': 'San Diego', 'NY': 'Albany', 'GA': 'Atlanta'} Question 24 2 pts In order to avoid KeyError exceptions, you can check whether a key is in the dictionary using the operator. included in isnotin isin Question 25 2 pts Which method is automatically executed when an instance of a class is created in memory? 

Option 1

Low Cost Option
Download this past answer in few clicks

12.89 USD

PURCHASE SOLUTION

Already member?


Option 2

Custom new solution created by our subject matter experts

GET A QUOTE

Related Questions