Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. C language exercise - beginner

C language exercise - beginner

Scheduled Pinned Locked Moved C / C++ / MFC
questionlearning
9 Posts 8 Posters 3 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Senhor League
    wrote on last edited by
    #1

    Solve in C language: 1: "A savings account was opened with a deposit of $500.00. Imagine that this account is paid at 1% interest per month. What will the account value be after three months?" 2: "Make a program with 2 variables, A and B, where A will have the value 40 and B will have the value -1. Print the value of A+B, A-B, AxB and A/B. Then make B increment by a drive and repeat the 4 operations."

    V CPalliniC D J B 5 Replies Last reply
    0
    • S Senhor League

      Solve in C language: 1: "A savings account was opened with a deposit of $500.00. Imagine that this account is paid at 1% interest per month. What will the account value be after three months?" 2: "Make a program with 2 variables, A and B, where A will have the value 40 and B will have the value -1. Print the value of A+B, A-B, AxB and A/B. Then make B increment by a drive and repeat the 4 operations."

      V Offline
      V Offline
      Victor Nijegorodov
      wrote on last edited by
      #2

      And what is your question?

      1 Reply Last reply
      0
      • S Senhor League

        Solve in C language: 1: "A savings account was opened with a deposit of $500.00. Imagine that this account is paid at 1% interest per month. What will the account value be after three months?" 2: "Make a program with 2 variables, A and B, where A will have the value 40 and B will have the value -1. Print the value of A+B, A-B, AxB and A/B. Then make B increment by a drive and repeat the 4 operations."

        CPalliniC Offline
        CPalliniC Offline
        CPallini
        wrote on last edited by
        #3

        as a starter, I give you the 'compute_interest' skeleton. To complete it is up to you

        double compute_interest(double deposit, int months)
        {
        double interest;
        // TODO: compute the result here
        return interest;
        }

        "In testa che avete, Signor di Ceprano?" -- Rigoletto

        In testa che avete, signor di Ceprano?

        1 Reply Last reply
        0
        • S Senhor League

          Solve in C language: 1: "A savings account was opened with a deposit of $500.00. Imagine that this account is paid at 1% interest per month. What will the account value be after three months?" 2: "Make a program with 2 variables, A and B, where A will have the value 40 and B will have the value -1. Print the value of A+B, A-B, AxB and A/B. Then make B increment by a drive and repeat the 4 operations."

          D Offline
          D Offline
          David Crow
          wrote on last edited by
          #4

          At this rate, you might want to plan on staying a beginner. :rolleyes:

          "One man's wage rise is another man's price increase." - Harold Wilson

          "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

          "You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles

          1 Reply Last reply
          0
          • S Senhor League

            Solve in C language: 1: "A savings account was opened with a deposit of $500.00. Imagine that this account is paid at 1% interest per month. What will the account value be after three months?" 2: "Make a program with 2 variables, A and B, where A will have the value 40 and B will have the value -1. Print the value of A+B, A-B, AxB and A/B. Then make B increment by a drive and repeat the 4 operations."

            J Offline
            J Offline
            jsc42
            wrote on last edited by
            #5

            Senhor League wrote:

            Then make B increment by a drive and repeat the 4 operations

            What does that mean? Is it a quirk of Google Translate? Based on the language that I thought seemed reasonable given your CP username, I tried Google translate from English to Portuguese (Em seguida, faça o incremento B por uma unidade e repita as 4 operações) and back to English. That gives "Then increment B by one unit and repeat the 4 operations." - that makes more sense.

            G 1 Reply Last reply
            0
            • J jsc42

              Senhor League wrote:

              Then make B increment by a drive and repeat the 4 operations

              What does that mean? Is it a quirk of Google Translate? Based on the language that I thought seemed reasonable given your CP username, I tried Google translate from English to Portuguese (Em seguida, faça o incremento B por uma unidade e repita as 4 operações) and back to English. That gives "Then increment B by one unit and repeat the 4 operations." - that makes more sense.

              G Offline
              G Offline
              Graham Breach
              wrote on last edited by
              #6

              Maybe Google Translate tried to solve it and encountered a divide by zero error.

              B 1 Reply Last reply
              0
              • S Senhor League

                Solve in C language: 1: "A savings account was opened with a deposit of $500.00. Imagine that this account is paid at 1% interest per month. What will the account value be after three months?" 2: "Make a program with 2 variables, A and B, where A will have the value 40 and B will have the value -1. Print the value of A+B, A-B, AxB and A/B. Then make B increment by a drive and repeat the 4 operations."

                B Offline
                B Offline
                Bram van Kampen
                wrote on last edited by
                #7

                The question is: Do you seriously want to learn how to become an IT specialist, who can code, or are you more interested in the party type student life. The problems you want resolved are quite trivial, and I could easily write you the required lines. However, I will not! You seem to be early in your course. I have no doubt that your college provided you with the resources required where you can find out how to write this code. Read it, and Try it out, fail and Learn. Writing Code is about Trying and Learning, the whole time. You write the Code, Compile it. You get Compiling errors. That means that the Compiler does not understood what you wrote. Solve them, it Compiles. Now you have a running program or App. Does the App do what you want it to do! Very Often it does not. They call that Debugging! I learned C and CPP/MFC the hard way. By myself, trial and error. My University simply did not have a computer that students could work with in 1974. My first computer was a Commodore 64 in 1985, where I learned the beginnings of Machine Code and ASM programming. A small PC with a C Compiler came as a godsend, and at the time I was in no doubt what compilers linkers, and debug/retail versions did and could do. You have an institution with resources behind you. Use those resourses and learn. Stop asking this forum to resolve your exam questions. Believe it or not, Everybody on this forum has met intractable issues, All of us have been students, one way or the other. We deal with real science here. Helping you to spoof your exam is never a way forward.

                Bram van Kampen

                1 Reply Last reply
                0
                • G Graham Breach

                  Maybe Google Translate tried to solve it and encountered a divide by zero error.

                  B Offline
                  B Offline
                  Bram van Kampen
                  wrote on last edited by
                  #8

                  I think you are a bit harsh! We all had to learn! Maybe Codeproject should start a Beginners Page

                  Bram van Kampen

                  L 1 Reply Last reply
                  0
                  • B Bram van Kampen

                    I think you are a bit harsh! We all had to learn! Maybe Codeproject should start a Beginners Page

                    Bram van Kampen

                    L Offline
                    L Offline
                    Lost User
                    wrote on last edited by
                    #9

                    Bram van Kampen wrote:

                    I think you are a bit harsh! We all had to learn!

                    Indeed we did, and for many of us there was no internet to help. But there seems to be an attitude among a number of students (I assume a minority) these days that they do not have to put any actual effort into learning. We get regular questions in QA of this type, which at best are, "please do my assignment". Some of them even use the excuse that they don't have time to learn, or it must be ready by tomorrow at the latest.

                    1 Reply Last reply
                    0
                    Reply
                    • Reply as topic
                    Log in to reply
                    • Oldest to Newest
                    • Newest to Oldest
                    • Most Votes


                    • Login

                    • Don't have an account? Register

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • World
                    • Users
                    • Groups