Computers and Technology
Computers and Technology, 22.07.2020 17:01, sakhya04

Objective The objective of this project is to give you some experience working with DVD objects created from a user-defined DVD class and passing DVD objects to functions that manipulate them. The objects you will model in this project will be software DVDs. You will create several DVD objects and then load information into their instance variables. All of these DVD objects will then be passed to a global function that displays the instance variable values of each DVD object it receives. All of these DVD objects will then be passed to another global function that computes and displays the total cost as well as the average cost for the DVDs it receives. Finally, a function that receives a single DVD object will be called twice – once for each of the two DVD objects. This function will allow the user to interactively change user-selected data items in the single DVD object passed to this function.
This project represents a hybrid solution which incorporates both objects of a Python class as well as global, free-standing, C-like functions that process object(s) passed to them. Hybrid solutions such as this are actually the most common solutions found in practice since the world typically cannot be ENTIRELY modeled as objects!
Specifications (minimum)
The DVD class contains the following instance variables:.
self.__Title;
// The Name of the DVD
self.__DVDType;
// The Type of DVD
self.__Cost;
// The Cost of the DVD
The ONLY recognized (i. e., legal) software DVD types are, "Game", "Word", "Compiler", "Spreadsheet", "Dbase", and "Presentation" (AND, no others!).
The DVD class contains (at a minimum) the following methods:
__init__(self, InTitle, InDVDType, InCost): . . .
// Constructor – initialize instance variables
// with (validated) parameter values
setTitle(selfNewTitle): . . .
// Change the self.__Title instance variable value
setType(self NewType): . . .
// Validate and change the self.__DVD_Type instance variable value
getTitle(self): . . .
// Return self.__Title instance variable value
setType(self NewType): . . .
// Validate and change the self.__DVD_Type instance variable value
getCost(self): . . .
// Return the value in the self.__Cost instance variable value
loadInformation(self): . . .
// Interactively prompt-for, input, and set all instance variables
listValidDVDtypes(self): . . .
// Support method that displays list of valid DVD types
The global functions are as follows:
Prototype:
def Display_DVD_Information(DVD1, DVD2, DVD3): . . .
Pseudo code:
For each DVD object parameter, retrieve and display its instance variable values in a nicely-formatted list (or table).
Prototype:
def (DVD1, DVD2, DVD3): . . .
Pseudo code:
Retrieve and sum the individual costs of the DVD objects and display the total cost and then display the average cost
Prototype:
def ChangeDVD(A_DVD): . . .
Pseudo code:
Interactively change the instance variable value of the passed-in DVD object. For the current value of each instance variable be sure to FIRST display this value before asking your user whether he/she wants to change this value. If so, the prompt-for, input, validate(where necessary) and then save the new instance variable value.
The main() function will:
Declare several (at least three) individual DVD objects, e. g.,
DVD1 = DVD(, , ) // etc.
Call the global function, Display_DVD_Information(…), to display the contents of each of the DVD objects passed to this function. This will demonstrate that your DVD constructor works as you implemented it. Load each DVD object with information of your choice by calling member function, LoadInformation(), on each DVD object, e. g.,
DVD1.LoadInformation(); // etc.
Call the global function, Display_DVD_Information(…), again to display the contents of each of the DVD objects passed to this function after you have loaded each DVD object with user-selected values.
Next, call the global function, (…) to compute and display, 1) the total cost and then, 2) the average cost of the DVD objects passed to this function.
Call global function, ChangeDVD(…), for each of the first two DVD objects.
Call global function, Display_DVD_Information(…), again to see the changes just made to the first two DVDs.
Call global function, (…), again to see how the total and average costs have changed.

answer
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 02:30, amaliabarrera9
The can be used to paste text in any order
Answers: 1
image
Computers and Technology, 22.06.2019 12:10, Geo777
1. package newton’s method for approximating square roots (case study 3.6) in a function named newton. this function expects the input number as an argument and returns the estimate of its square root. the script should also include a main function that allows the user to compute square roots of inputs until she presses the enter/return key. 2. convert newton’s method for approximating square roots in project 1 to a recursive function named newton. (hint: the estimate of the square root should be passed as a second argument to the function.) 3. elena complains that the recursive newton function in project 2 includes an extra argument for the estimate. the function’s users should not have to provide this value, which is always the same, when they call this function. modify the definition of the function so that it uses a keyword parameter with the appropriate default value for this argument, and call the function without a second argument to demonstrate that it solves this problem. 4. restructure newton’s method (case study 3.6) by decomposing it into three cooperating functions. the newton function can use either the recursive strategy of project 1 or the iterative strategy of case study 3.6. the task of testing for the limit is assigned to a function named limitreached, whereas the task of computing a new approximation is assigned to a function named improveestimate. each function expects the relevant arguments and returns an appropriate value. 5. a list is sorted in ascending order if it is empty or each item except the last one is less than or equal to its successor. define a predicate issorted that expects a list as an argument and returns true if the list is sorted, or returns false otherwise. (hint: for a list of length 2 or greater, loop through the list and compare pairs of items, from left to right, and return false if the first item in a pair is greater.)
Answers: 1
image
Computers and Technology, 22.06.2019 16:10, katherineweightman
When copying and pasting text, the first step is move your cursor type the text select the copy command select the paste command
Answers: 2
image
Computers and Technology, 22.06.2019 16:30, sayedaly2096
What type of file does a cookie place on web site visitors' computers so that web site managers can customize their sites to their visitors' preferences?
Answers: 1
Do you know the correct answer?
Objective The objective of this project is to give you some experience working with DVD objects cre...

Questions in other subjects:

Konu
Mathematics, 09.01.2020 09:31