input: Write a python function to convert a given amount of currency to dollars using a class.
  assert Currency("USD", 10.0).convert_to_dollars() == 10.0
  assert Currency("EUR", 20.0).convert_to_dollars() == 20.0 # assuming rate is 1.0
  assert Currency("JPY", 1000.0).convert_to_dollars() == 1000.0 # assuming rate is 1.0
output: class Currency:
      exchange_rates = {
          "USD": 1.0,  # 1 USD = 1 USD
          "EUR": 1.0,  # Assuming 1 EUR = 1 USD for the sake of the assertion
          "JPY": 1.0   # Assuming 1 JPY = 1 USD for the sake of the assertion
      }
  
      def __init__(self, currency_code, amount):
          self.currency_code = currency_code
          self.amount = amount
  
      def convert_to_dollars(self):
          rate = self.exchange_rates.get(self.currency_code, 1.0)
          return self.amount * rate