subject
Computers and Technology, 21.05.2020 00:08 fish64

For this question you will create an object to store information on an inventory of cars. Create a class called CarInventory Instance Attibutes: n_cars : int cars : list Methods add_car() compare() Details: The constructor (__init__) should take no inputs, but set n_cars to 0, and cars to be [] (an empty list). Method: add_car Input(s): manufacturer : string model : string year : int mpg : float Procedure(s): Create a dictionary from the values passed with the corresponding keys 'manufacturer', 'model', 'year' and 'mpg' Append this dictionary to the cars attribute Increment the n_cars attribute by 1 Method: compare

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 10:30
How can a user open a blank presentation? 1.on the file menu, click new, and then click recent templates 2.on the file menu, click new, and then click blank presentation 3. on the view menu, click templates, and then click recent templates 4. on the view menu, click samples, and then click blank presentation
Answers: 1
question
Computers and Technology, 22.06.2019 19:20
Write a program that prompts the user to input a string. the program then uses the function substr to remove all the vowels from the string. for example, if str = "there", then after removing all the vowels, str = "thr". after removing all the vowels, output the string. your program must contain a function to remove all the vowels and a function to determine whether a character is a vowel.
Answers: 2
question
Computers and Technology, 22.06.2019 22:30
Write a full class definition for a class named player , and containing the following members: a data member name of type string .a data member score of type int .a member function called setname that accepts a parameter and assigns it to name . the function returns no value.a member function called setscore that accepts a parameter and assigns it to score . the function returns no value.a member function called getname that accepts no parameters and returns the value of name .a member function called getscore that accepts no parameters and returns the value of score .this is what i have, aparently this is wrong: class player{private: string name; int score; public: void player: : setname (string n){name =n; }void player: : setscore (int s){score = s; }string player: : getname (){return name; }int player: : getscore (){return score; }};
Answers: 2
question
Computers and Technology, 23.06.2019 20:00
How much current flows through the alternator brushes? a. 2–5 a b. 25–35 a, depending on the vehicle c. 5–10 a d. 10–15 a
Answers: 2
You know the right answer?
For this question you will create an object to store information on an inventory of cars. Create a c...
Questions
question
Mathematics, 03.03.2021 09:40
question
Mathematics, 03.03.2021 09:40
question
Mathematics, 03.03.2021 09:40
question
Mathematics, 03.03.2021 09:40
Questions on the website: 13722361