1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Alex787 [66]
3 years ago
14

I need help with completing this python code.Complete the Car class by creating an attribute purchase_price (type int) and the m

ethod print_info() that outputs the car's information.Ex: If the input is:2011180002018where 2011 is the car's model year, 18000 is the purchase price, and 2018 is the current year, then print_info() outputs:Car's information: Model year: 2011 Purchase price: 18000 Current value: 5770Note: print_info() should use three spaces for indentation.class Car:def __init__(self):self.model_year = 0# TODO: Declare purchase_price attributeself.current_value = 0def calc_current_value(self, current_year):depreciation_rate = 0.15# Car depreciation formulacar_age = current_year - self.model_yearself.current_value = round(self.purchase_price * (1 - depreciation_rate) ** car_age)# TODO: Define print_info() method to output model_year, purchase_price, and current_valueif __name__ == "__main__":year = int(input())price = int(input())current_year = int(input())my_car = Car()my_car.model_year = yearmy_car.purchase_price = pricemy_car.calc_current_value(current_year)my_car.print_info()
Computers and Technology
1 answer:
netineya [11]3 years ago
4 0

Answer:

class Car:

   def __init__(self):

       self.model_year = 0

       # TODO: Declare purchase_price attribute

       self.purchase_price = 0

       self.current_value = 0

   def calc_current_value(self, current_year):

       depreciation_rate = 0.15

       # Car depreciation formula

       car_age = current_year - self.model_year

       self.current_value = round(self.purchase_price * (1 - depreciation_rate) ** car_age)

# TODO: Define print_info() method to output model_year, purchase_price, and current_value

   def print_info(self):

       print("Model year: ",self.model_year)

       print("Purchase year: ",self.purchase_price)

       print("Current value: ",self.current_value)

def main():

   year = int(input())

   price = int(input())

   current_year = int(input())

   my_car = Car()

   my_car.model_year = year

   my_car.purchase_price = price

   my_car.calc_current_value(current_year)

   my_car.print_info()

if __name__ == "__main__":

   main()

Explanation:

The Car class in the python program is used to create a car object instance with class methods model_year, purchase_price, and calc_current_value, which accepts as arguments, year, price and current_year respectively. The main function runs if only the python module is run and interpreted to print out the year and current price of a car object instance defined.

You might be interested in
_____ refers to the busiest calling hour of the day, week, month or year. And _____ refers to the average length of time the sub
Butoxors [25]

Answer: a) busy hour  b) Average handle time.

Explanation:

a) In order to design a telephony circuit, trunk, or call center, it is needed to take into account the busiest calling hour (as a "sliding" 60-minute period) in one day, or week, month or year, generally calculated as an average.

This period is called the "busy hour" and is used to compute the traffic intensity, in Erlangs, considering that if the circuit is busy 100% of the time during 3600 seconds, it will be cursing 1 Erl of traffic.

This traffic can result from 60 calls of 1 min each, 36 calls of 100 sec each, or any combination that have the same outcome of 1 Erl.

b) In order to define, for instance, the number of employees in a call center, a very important parameter is the average time used for each call, adding the queuing time, the true talk time and any other time needed to  set up a successful call, i.e., the time that the subscriber stays on the phone after putting the call.

This time is known as AHT (Average Handle Time).

3 0
4 years ago
Fill in the blank with the correct response.<br> A _<br> is an unknown network.
alexgriva [62]

Answer:

ip address

Explanation:

please mark brainliest

7 0
3 years ago
2- There are many different design parameters that are important to a cache’s overall performance. Below are listed parameters f
katen-ka-za [31]

Answer:

1. 2588672 bits

2. 4308992 bits

3. The larger the data size of the cache, the larger the area of ​​memory you will need to "search" making the access time and performance slower than the a cache with a smaller data size.

Explanation:

1. Number of bits in the first cache

Using the formula: (2^index bits) * (valid bits + tag bits + (data bits * 2^offset bits))

total bits = 2^15 (1+14+(32*2^1)) = 2588672 bits

2. Number of bits in the Cache with 16 word blocks

Using the formula: (2^index bits) * (valid bits + tag bits + (data bits * 2^offset bits))

total bits = 2^13(1 +13+(32*2^4)) = 4308992 bits

3. Caches are used to help achieve good performance with slow main memories. However, due to architectural limitations of cache, larger data size of cache are not as effective than the smaller data size. A larger cache will have a lower miss rate and a higher delay. The larger the data size of the cache, the larger the area of ​​memory you will need to "search" making the access time and performance slower than the a cache with a smaller data size.

5 0
3 years ago
What is a technology?​
Leokris [45]

Answer:

The definition of technology is science or knowledge put into practical use to solve problems or invent useful tools

                                                    OR

Technology is the sum of techniques, skills, methods, and processes used in the production of goods or services or in the accomplishment of objectives, such as scientific investigation

7 0
3 years ago
What is binary in computer science ​
timurjin [86]

Answer:

binary is a language.

Explanation:

Well it is a language which uses only two numbers, 0 and 1. This is the language that computer understands. 0 in general means true and 1 in general means false. Binary codes are used for various methods of encoding data.

6 0
4 years ago
Other questions:
  • How do smart watches affect the business and its position in the global marketplace?
    12·2 answers
  • you work in the Human Resources department of a company that has partnered with a similar company in Brazil on a big contract. y
    12·1 answer
  • Rather than a single address, you can refer to an array using their first (top/Left) and last (bottom/right) addresses separated
    15·1 answer
  • Bushman and bonacci (2004) found that prejudiced participants were ____ likely to return a lost e-mail that had been addressed t
    5·1 answer
  • C programming:
    13·1 answer
  • How to delete a virus that act by restarting u r computer? I am in safe mood to aviod restart.
    10·1 answer
  • __________ is a single set of hardware, databases, networks, people, and procedures configured to collect, manipulate, store, an
    8·1 answer
  • (Bible)<br> Sin may be an inward thought or an outward act. True False
    11·2 answers
  • Who Find the exact web server that hosted the website by looking in a huge database of internet addresses
    8·1 answer
  • What does the term attenuation mean in data communication?
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!