This is for Python class questions.
1 Python question: While you can add or subtract an int value to or from a Decimal object, you cannot __________ Decimal objects with __________.
A multiply, ints
B mix, float values
C divide, anything
D mix, the quantize method
2 Python question: One way to deal with unexpected results that may come from floating-point numbers is to use rounding, but you can also use decimal numbers by importing the __________ from the __________.
A decimal numbers, Decimal object
B Decimal class, Decimal object
C decimal numbers, decimal module
D Decimal class, decimal module
3 Python question: When a value is passed by __________ to a function, the function receives its value, but when a value is passed by __________, the function receives a reference to that value in storage.
A reference, value
B value, reference
C a call, argument
D its name, its value
4 Python question: A module __________
A is a file that contains three or more functions
B cannot receive data from a source outside that module
C is a file that contains reusable code
D All of these are true about modules.
5 Python question: A local variable __________.
A is defined inside a function
B can only be used within the function that defines it
C is not available to the program outside the function that defines it
D All of these are true about local variables.
6 Python question: Python is considered a good first language because __________.
A is has a simple syntax
B it has all the features of traditional programming languages
C it is open source
D All of these are good reasons Python is often chosen as a first programming language.
`Hey,
Note: Brother if you have any queries related the answer please do comment. I would be very happy to resolve all your queries.
1) OPTION B IS CORRECT
2) OPTION D IS CORRECT
3) OPTION B IS CORRECT
4) OPTION D IS CORRECT
Note: Brother According to HomeworkLib's policy we are only allowed to answer first 4 part if there are many. So, I request you to post other part as separate posts
Kindly revert for any queries
Thanks.
This is for Python class questions. 1 Python question: While you can add or subtract an...
1. In Python, 'mutable' objects such as lists are passed to functions 'by reference'. This means: a.) Changes made to the object within the function persist after the function completes b.) The function receives a copy of the object c.) Python keeps a history of where then object was used d.) Statements in the function can refer to the object by nickname 2. Which of the following is NOT a requirement for a Python function: a.) The function must have...
Look at this partial class definition, and then answer questions a - b below: Class Book Private String title Private String author Private String publisher Private Integer copiesSold End Class Write a constructor for this class. The constructor should accept an argument for each of the fields. Write accessor and mutator methods for each field. Look at the following pseudocode class definitions: Class Plant Public Module message() Display "I'm a plant." End Module...
Using Python: Par 1. You will define Student class with the following attributes: CWID: the student’s CWID FirstName: the student’s first name LastName: the student’s last name Gender: the student’s gender (‘M’ or ‘F’) BirthDate: the student’s date of birth (e.g. ‘03/14/1999’) ClassID: the class id that the student took ClassDate: the date when the student took the class (e.g. ‘01/26/2018’) Grade: the student’s grade for the class In addition, you will do the following tasks: Implement a set of...
Part 1. (60 pts) 1. Define an Address class in the file Address.h and implement the Address class in Address.cpp. a. This class should have two private data members, m_city and m_state, that are strings for storing the city name and state abbreviation for some Address b. Define and implement public getter and setter member functions for each of the two data members above. Important: since these member functions deal with objects in this case strings), ensure that your setters...
Can you send the code and the screenshot of it running?
1) Create a PYHW2 document that will contain your algorithms in flowchart and pseudocode form along with your screen shots of the running program. 2) Create the algorithm in both flowchart and pseudocode forms for the following two functions: A. Write a Python function that receives a real number argument representing the sales amount for videos rented so far this month The function asks the user for the number...
project-8c Write a class named Employee that has data members for an employee's name, ID_number, salary, and email_address (you must use those names - don't make them private). Write a function named make_employee_dict that takes as parameters a list of names, a list of ID numbers, a list of salaries and a list of email addresses (which are all the same length). The function should take the first value of each list and use them to create an Employee object....
QUESTION 21 while True: , in Python, can be used to create an infinite loop. True False 2 points QUESTION 22 The Python Framework does inform you where an error occurred True False 2 points QUESTION 23 ____ is a critical component to being able to store data and information long term. File Access Memory Print function with 2 points QUESTION 24 Error handling is also known as ___ handling Result Recursion Exception Crash 2 points ...
How to add class objects to a dictionary? *PYTHON ONLY* NO IMPORT RANDOM Write a class named Employee that has data members for an employee's name, ID_number, salary, and email_address (you must use those names - don't make them private). Write a function named make_employee_dict (outside of the Employee class) that takes as parameters a list of names, a list of ID numbers, a list of salaries and a list of email addresses. The function should take the first value...
1) Using the Object-Oriented Programming Paradigm,implement the necessary code in Python creating a ‘Car’ class with a constructor that stores all the Car information (ID, MAKE, MODEL, YEAR , COLOR, MILEAGE, PRICE_TO_DEALER, SALE_PRICE, PROFIT) as attributes. 2) Implement and add the following methods to the ‘Car' class in Question 1. a) necessary getter methods b) necessary setter methods c) method to display all the information to the screen d) a method to calculate the profit
C++ programming question Topic: Class 'Date' Hello everybody, can some one help me... ... Write a class Date with the following properties: a) Data elements of the class are day, month, year. All three data elements are defined by the Type int. b) A set and a get element function are to be provided for each data element. In Within the framework of this task, it should be assumed that the values that are passed for day and year, are...