31
Bubbles
8y

So today I made my first basic program in C++ from scratch that worked! After some troubleshooting.. But I thought of ways I could edit it and make it better!

Comments
  • 4
    Why do you have an extra indentation for the of and else clause?

    Next task could be: pass grade and goal as arguments to the main. 😉
  • 1
    it weird to read if goal is less than grade. usually the order would be if grade < goal you fail. the variable is on left and constant on right
  • 0
    @itsmill3rtime I had it like that but I changed it
  • 1
    @Yeah69 could you explain what that means a little? I'm sorry I'm just new to all of the words
  • 2
    Congrats keep coding
  • 1
    @itsmill3rtime for evaluating conditions the constant then variable style is better so you don't make errors like :
    if( goal = 57)
  • 3
    @byte Ironically, this code is errored. Should be ==
  • 1
    @SpencerBeige it was meant to show an error
    if( variable = constant) => true but wrong output
    but
    if(constant = variable) => does not compile
    Thus
    if(constant == variable) => true and correct output
  • 1
    @Bubbles I could give you a shitty explanation (because I cannot explain well) or you could Google it and are likely to find a good description.

    Please, make it a habit to search for new keywords yourself first, before asking for an explanation. In the Internet there is a ridiculous amount of information to anything for free.

    It is a good thing that you asked us for feedback to give you some pointers on the right direction, but going the way yourself is part of the process ;)

    The keyword to search here is "program options" or "program arguments".
  • 1
    @Yeah69 Okay thank you! I will get into the habit of doing that!!
  • 1
    BTW if I Google a specific programming matter, I always prefer the results leading to stackoverflow. It is a really good Q&A community for anything related to programming.
  • 1
    @Yeah69 I've noticed that, is there any other sites to look for?
  • 1
    @Bubbles to my knowledge there is no other site like stackoverflow. There are some worthy blogs I guess. But they don't cover as much and are often spezialised.
  • 1
    @Yeah69 Okay thank you!!
Add Comment