Announcement

Collapse
No announcement yet.

Anyone here use C++?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Anyone here use C++?

    Just starting taking a C++ programming class and am lost. Anyone here do programming?
    88 YJ...kinda. Clayton Hard Arms, V8, 1 tons w/Detroits, twin sticked T-18/NP205, Irok's, MasterCrafts, fuel cell, multi-colored

  • #2
    Originally posted by Wide-J View Post
    Just starting taking a C++ programming class and am lost. Anyone here do programming?
    I have a degree in computer Science and did 4 years pf c/c++ programing.

    Have not touched the stuff in years but i still remember most of it, what do you need help with?

    If then statements, do loops, do while loops? conditions, functions
    "when I'm riding my motorcycle,I'm glad to be alive...when I stop riding my motorcycle,I'm glad to be alive"

    Comment


    • #3
      i'm also in computer science, just starting out still but know some. i primarily work with java though.
      Hack Shack Racing #4632 Jeep TJ

      Comment


      • #4
        Well I just started but am finding that writing code is tricky. I am working on one to convert Nm to Weight.
        88 YJ...kinda. Clayton Hard Arms, V8, 1 tons w/Detroits, twin sticked T-18/NP205, Irok's, MasterCrafts, fuel cell, multi-colored

        Comment


        • #5
          Here is the code that I have written but I am sure I am way off. Anyone have feedback?

          /*---------------------------------------------------------------------------*/
          /* Weight Conversion */
          /* */
          /* This will convert Newtons to Pounds */

          #include <iostream> // Required for cout, endl.
          #include <cmath> // Required for sqrt()

          using namespace std;

          int main()
          {
          // Declare and initialize objects.
          double LB(1), N(4.48);

          // Compute each pound to newtons.
          LB*N;

          //Print distance;
          ;cout << "Converted pounds to Newtons";
          endl;

          // Exit program.
          return 0;
          {
          /*-------------------------------------------------------------------*/
          88 YJ...kinda. Clayton Hard Arms, V8, 1 tons w/Detroits, twin sticked T-18/NP205, Irok's, MasterCrafts, fuel cell, multi-colored

          Comment


          • #6
            you didnt output anything besides "Converted..."

            you need to create a variable for the result like

            double result;

            result = lb*n;

            then cout result

            also second to last line should be } not { and no ; b4 cout

            also you dont need to put ; at the end off your comments " // comment;"
            "when I'm riding my motorcycle,I'm glad to be alive...when I stop riding my motorcycle,I'm glad to be alive"

            Comment


            • #7
              are you going to have the user input any of the data?
              "when I'm riding my motorcycle,I'm glad to be alive...when I stop riding my motorcycle,I'm glad to be alive"

              Comment


              • #8
                also its good practice to put the "endl" on the same line of your output


                cout << "Hello World!" << endl;

                so if you wanted to output your results you can do

                cout << "Converted " << LB << " pounds to newtons is: " << result << endl;

                </pre>
                "when I'm riding my motorcycle,I'm glad to be alive...when I stop riding my motorcycle,I'm glad to be alive"

                Comment


                • #9
                  This class is entirely frustrating. It is an online course and we are using a book that is not the beginner book...That's great for anyone that knows anything about programming I suppose. Now I have to create an even more complex file and have no idea how to begin. Especially since the last file I created didnt work.
                  88 YJ...kinda. Clayton Hard Arms, V8, 1 tons w/Detroits, twin sticked T-18/NP205, Irok's, MasterCrafts, fuel cell, multi-colored

                  Comment


                  • #10
                    what do you have to accomplish in the next file?

                    What program are you using to debug/edit in?
                    "when I'm riding my motorcycle,I'm glad to be alive...when I stop riding my motorcycle,I'm glad to be alive"

                    Comment


                    • #11
                      I am using Microsoft Visual Stuido 10. Now I need to write a program that sks the user to enter the number or atoms of each of the five elements for an amino acid. Then compute and print the molecular weight for this amino acid.
                      88 YJ...kinda. Clayton Hard Arms, V8, 1 tons w/Detroits, twin sticked T-18/NP205, Irok's, MasterCrafts, fuel cell, multi-colored

                      Comment


                      • #12
                        coding is all about syntax..... just knowing the right way to set up code, the rest is jsut calculations that you can look up.

                        also your #includes were no correct on your first program
                        should be:


                        #include <iostream>

                        using namespace std;



                        and input is easy

                        double var1;
                        cout << "Please enter variable 1: " <<endl;<endl;>
                        cin >> var1;



                        bang thats it
                        </endl;></iostream>
                        "when I'm riding my motorcycle,I'm glad to be alive...when I stop riding my motorcycle,I'm glad to be alive"

                        Comment


                        • #13
                          I think I am going to drop the class. I am completely lost on everything. I really hate that it is an online course. This is the first time they are trying it. For me, it doesnt work at all!
                          88 YJ...kinda. Clayton Hard Arms, V8, 1 tons w/Detroits, twin sticked T-18/NP205, Irok's, MasterCrafts, fuel cell, multi-colored

                          Comment

                          Working...
                          X