input: Write a function that calculates the compound interest based on the investment amount, rate of interest, and time period. If either of the inputs is zero, return 0. If the rate of interest is negative, return -1. The function should return the calculated compound interest.
  
  assert compoundInterest(1000, 5, 5)==1276.2815625
  assert compoundInterest(0, 5, 5)==0
  assert compoundInterest(1000, 0, 5)==0
  assert compoundInterest(1000, 5, 0)==0
  assert compoundInterest(1000, -5, 5)==-1
  assert compoundInterest(1000, 10, 3)==1331.000
  
output: def compoundInterest(amount, rate, time):
      if amount == 0 or rate == 0 or time == 0:
          return 0
      if rate < 0:
          return -1
      return round(amount * (1 + rate / 100) ** time, 7)