Lack of motivation with my course C/C++

Hi,

I guess some of you suffered me asking for some questions I have while I am doing a course I enrolled about C/C++. I ask you your apologizes and also thank you for having patience with me. I am not a programmer, I am a Chemical Engineer going through really hard times, I lost my jobs and I am unemployed so I decided to take some courses of programming just to earn a new skill and to refresh what I have learned from my degree several years ago in the very first year. So, I don't mean I will be a programmer, this is only to have an skill for related jobs in case an employer asks for basics programming skills (I know I m not able to take a programming job and is not my field of knowledge).

My course is intensive and sometimes I feel streesed because we only have one 5 hour class a week and we are required to solve around 17 excercises every week, so I feel I won't be able to solve them on time. This week for any reason I have 21 which is overwhelming for me. This sometimes discourages me, but further to this course, I realized with the years that this is extensive to every field. When things go hard, I just want to give up. Happened to me since things went bad professionally, I was stronger while I was studying my degree, so, I realized that due to my depression (unemployment, lack of motivation, dark future in the horizon) I am lacking of frustration tolerance. Bad feelings and thoughts come to my mind such as I won't be able to pass this course.

Yesterday I was stressed because I have to solve some exercise with chars and functions, so I skipped temporarily those exercises to solve others with numerical problems and functions that seems at least I am able to solve them in any way. I am lost with functions with chars so I would appreciate if someone could recommend me something to read to understand it and give another try to the remaining exercises (3). Just an example, I have one asking me to generate three "strings" (I don't know if this is the correct term), concatenate and copy them in a fourth string and sort the characters alphabetically. Since I don't know where to start, I streesed out myself, this is an example on how I collapse when I even don't know where to start and is a big issue since in engineering those situations are common.

Sorry for the off-topic and thank you for reading me.
> I have one asking me to generate three "strings" (I don't know if this is the correct term),
> concatenate and copy them in a fourth string and sort the characters alphabetically.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#include <iostream>
#include <string>
#include <algorithm>

int main()
{
    // generate three "strings" from user input
    // note: a string is just another name for a sequence of characters
    // https://cal-linux.com/tutorials/strings.html
    std::string first, second, third ;
    std::cout << "enter three strings (not containing spaces in them)\n" ;
    std::cin >> first >> second >> third ;

    // concatenate and copy them in a fourth string
    // to do this, we need to know that + concatenates strings
    // we do not need to know how this + works
    std::string fourth = first + second + third ;

    // print out the concatenated string
    std::cout << "the concatenated string is: " << fourth << '\n' ;

    // sort the characters alphabetically.
    // http://en.cppreference.com/w/cpp/algorithm/sort
    // read this as: sort the sequence of characters
    // from the beginning of fourth to the end of fourth
    // ie. sort the entire string
    // to do this, we need to know that a sort facility is available
    // as part of the standard; we do not need to know how this sort works
    std::sort( fourth.begin(), fourth.end() ) ;
    // ideally, at some future date, we would be able to simply write
    // std::sort(fourth)
    // at this point in time, that facility is still in the pipe line

    // print out the sorted string
    std::cout << "the sorted string is: " << fourth << '\n' ;
}


Some more information about learning (and teaching) C++ (any programming language):
http://www.cplusplus.com/forum/lounge/183836/#msg899457
Sorry to be so late. Thank you so much JLBorges. With some training I am improving but starting with C seems to be hard if you are not familiar with other languages as well.
Tell me about it. For me it's taken years to wrap my mind around programming. I'm coming to the conclusion that I'm actually quite stupid, and I'm too stupid to give up.

For motivation, I posted my struggles on a game coding crunch weekend. Check the next post down below, or the link in my profile pages.

Some suggestions when learning in a class - I personally believe you need to have about three personal projects of your own. For each class/lesson, try to figure out how this code can be added to one of your projects. This helps you learn as well as make it valuable. The class assignments are a flash in the pan. You get them done and move on with little to no effect. A personal project will help you keep and apply your code to something that will help out.

You said you are short on time, but even thinking about how the code needs to fit together for your own personal project is a great help, and you can do that as you wait in a lobby for your interview, while you wait in line, while you take a crap, while you shower, etc.
Last edited on
When I was in chemistry class, we kept journals and I loved the lay out:

// Start Date:
// Author:

// Purpose:

// Steps:

// Conclusions (how to use this code):

I start all my coding files this way. I write notes like I'm going to be talking to somebody who isn't familiar with my work *cough* myself in two years *cough*

Most of the time, just typing out my thoughts and I'll add snippets of code, and it allows me to get into the mind set for coding.

I hope this helps you as well.
Topic archived. No new replies allowed.