Pardon me if this isn’t the right place to ask but I need to make a compound-interest calculator, as a small high school project… with the feature that will help show the increase of investment over time

I just need to get the first part over with it…

Savings Simulator

Enter you initial investment: 600.00

Let’s invest your money

Interest Rate: 5

Number of years: 2

Year 1 $630.00

Year 2 $661.50…

https://docs.google.com/document/d/1Cebi50BQlEwuRnMG79TDZ178CHWMDTNIxN82b1xdASc/edit

  • mikyopii@programming.dev
    link
    fedilink
    arrow-up
    19
    ·
    10 months ago

    Do you have any code written? Generally speaking people are willing to help but won’t write your project for you.

  • Ziggurat@sh.itjust.works
    link
    fedilink
    English
    arrow-up
    11
    ·
    10 months ago

    Do you understand how compound interest work ? If yes write it down on a paper, and the code will flow. I don’t think we’ll be helping you on the long term by doing your homework.

  • Trent@lemmy.ml
    link
    fedilink
    English
    arrow-up
    9
    ·
    10 months ago

    So how did you end up with an assignment like this while apparently knowing little if any python? This feels like someone signed up for a class, blew it off, and now suddenly has tests and stuff to turn in.

    • GulbuddinHekmatyar@lemmy.mlOP
      link
      fedilink
      arrow-up
      1
      arrow-down
      4
      ·
      10 months ago

      Well, I was trying to learn in g-10, at the start (when I was in-class, not online) , I had some previous computer classes before (I did Virtual Basics and Scratch, html even) but I didn’t do Python (and this is supposed to be an intro, regardless of previous experience) … wtf you expect me to do?

      Plus, why do you assume this of me?

      • Trent@lemmy.ml
        link
        fedilink
        English
        arrow-up
        1
        ·
        10 months ago

        Because I’ve never seen a python class before that was ‘no experience required’ where they go “Well, normally we’d teach you about variables, and loops, functions and operator precedence…but you know what? Screw all that. Head first! YOLO! Write me some code.”

        If that is how that class is, I’d drop it and go hit youtube or something. How to Learn Python stuff is pretty available if you want to learn (and python is pretty useful).

    • GulbuddinHekmatyar@lemmy.mlOP
      link
      fedilink
      arrow-up
      1
      ·
      10 months ago

      Thanks, but my project requires also the results between the first and the last year the investment was increased…

      As a base, I’m testing $600, 5% interest, and 6 years to wait, so I need to show the amount for years 1-5 as output, before I see final result of the 6th year…

      I can’t just put:

      total1 = principle * pow((1 + rate/100), 1)

      print(f"Balance after {1} year/s: ${total1:.2f}")

      total2 = principle * pow((1 + rate/100), 2)

      print(f"Balance after {2} year/s: ${total2:.2f}")

      total3 = principle * pow((1 + rate/100), 3)

      print(f"Balance after {3} year/s: ${total3:.2f}")

  • Teknikal@lemm.ee
    link
    fedilink
    English
    arrow-up
    1
    ·
    10 months ago

    My advice is these new AI’s seem to be able to code given the right prompt, if it was me I’d try there for ideas.