What topic is "conditional structures" under?

In summary, "conditional structures" are things like if-else and loops and are covered in chapters 3 and 4 of the book. "Points and c-strings" are related to pointers and are covered in chapter 7. However, it is recommended to first learn C++ strings before C-strings as they are easier to use and are not directly related to pointers. So, it would not be necessary to learn about pointers and C-strings before taking a class on Object-Oriented Programming Using C++. However, understanding the basics of pointers and C-strings may be helpful in some cases, as they are still a part of C++ due to its backwards compatibility with C. C strings and pointers are closely related and are necessary
  • #1
annoyinggirl
218
10
So i have a book that covers the fundamentals one needs to know before starting C++. I'm self teaching myself so i don't have to take the intro programming class at school. Anyways, our professor sent us all a email that among a few other other topics (such as arrays and functions and loops), we must know how what "conditional structures" are and how to use them. However, unlike the other stuff he wants us to know, "conditional structures" doesn't have its own chapter in the book i"m reading. These are the chapters that my book has:

1). introduction to computers, programs, and C++ (100 percent sure it's not in this chapter)

2). primitive data types and operations

3). selection statements

4). loops

5). functions

6). arrays

7). points and c-strings

8). recursion


From which of the chapters listed above would I be most likely to learn about "conditional structures"?
 
Technology news on Phys.org
  • #2
annoyinggirl said:
So i have a book that covers the fundamentals one needs to know before starting C++. I'm self teaching myself so i don't have to take the intro programming class at school. Anyways, our professor sent us all a email that among a few other other topics (such as arrays and functions and loops), we must know how what "conditional structures" are and how to use them. However, unlike the other stuff he wants us to know, "conditional structures" doesn't have its own chapter in the book i"m reading. These are the chapters that my book has:

1). introduction to computers, programs, and C++ (100 percent sure it's not in this chapter)

2). primitive data types and operations

3). selection statements

4). loops

5). functions

6). arrays

7). points and c-strings

8). recursion


From which of the chapters listed above would I be most likely to learn about "conditional structures"?
Conditional structures are things like if-else and loops. The chapters that you're looking for above are 3 & 4. Recursion would also fall under this but you don't want to read that first. You need to really understand conditional statements before you tackle recursion.
 
  • #3
Thank you very much for your response! Also, under which of the following topics (loops, functions, arrays, conditional structures) would "points and c-strings" fall under?
 
  • #4
annoyinggirl said:
Thank you very much for your response! Also, under which of the following topics (loops, functions, arrays, conditional structures) would "points and c-strings" fall under?
It's been a long time since I've programmed C++. The title "points and c-strings" sounds like it's talking about Pointers which wouldn't be directly related to those topics.
 
  • #5
Yes, it's surely pointers and C-strings.

They go together because C-style strings ("C-strings") are represented using character arrays that are usually referred to via pointers. Therefore C students, and often C++ students, are forced to learn about pointers early on so they can use strings.

C++ has its own 'string' data type that doesn't involve using pointers, and many C++ programmers including me prefer to use it instead of C-strings. C++ strings are easier to use, precisely because they don't involve pointers. We use C-strings only when we're forced to, e.g. when using an API function that requires them. IMO a good C++ course should teach C++ strings first, and introduce C-strings later as a "C compatibility" topic.

Nevertheless, some C++ books and courses still teach C-strings first, IMO basically out of historical inertia. The 'string' data type was added to C++ (over 15 years ago!) after the language had been in use for several years, so early C++ textbooks used only C-strings. Later editions often added the newfangled strings and other new features like vectors by tacking on a chapter at the end. Also, many people come to C++ from a background of C programming, and tend to think of C-strings before C++ strings.
 
Last edited:
  • #6
jtbell said:
Yes, it's surely pointers and C-strings.

They go together because C-style strings ("C-strings") are represented using character arrays that are usually referred to via pointers. Therefore C students, and often C++ students, are forced to learn about pointers early on so they can use strings.

C++ has its own 'string' data type that doesn't involve using pointers, and many C++ programmers including me prefer to use it instead of C-strings. C++ strings are easier to use, precisely because they don't involve pointers. We use C-strings only when we're forced to, e.g. when using an API function that requires them. IMO a good C++ course should teach C++ strings first, and introduce C-strings later as a "C compatibility" topic.

Nevertheless, some C++ books and courses still teach C-strings first, IMO basically out of historical inertia. The 'string' data type was added to C++ (over 15 years ago!) after the language had been in use for several years, so early C++ textbooks used only C-strings. Later editions often added the newfangled strings and other new features like vectors by tacking on a chapter at the end. Also, many people come to C++ from a background of C programming, and tend to think of C-strings before C++ strings.

Oh. Thank you! that is very informative and helpful. So to clarify, it wouldn't be necessary to learn how to use "pointers and C-strings " before taking "Object-Oriented Programming Using C++" class?
 
  • #7
annoyinggirl said:
Oh. Thank you! that is very informative and helpful. So to clarify, it wouldn't be necessary to learn how to use "pointers and C-strings " before taking "Object-Oriented Programming Using C++" class?

If it is a good course on OOP using C++, it would probably be better not to know about them (particular about pointers), otherwise you would have to unlearn the "wrong" way to do some things. (But there are bad courses and books on C++ which were "upgraded" from courses and book on C with the minimum amount of effort!)

Those things are part of C++ because it was designed to be backwards-compatible with C. Some other object-oriented languages don't have any explicit concept of a "pointer" at all.

On the other hand "C strings and pointers" are more or less inseparable from each other, and you can't do anything much that involves text in C (for example reading and writing data to files) without pointers.
 
  • #8
annoyinggirl said:
So i have a book that covers the fundamentals one needs to know before starting C++. I'm self teaching myself so i don't have to take the intro programming class at school.

It appears from this that your school's intro programming class doesn't use C++. What language does it use?

As for pointers and C-strings, if your professor didn't say anything about them explicitly, I wouldn't worry about them. Maybe ask him about this if you want to make sure.
 
  • #9
jtbell said:
It appears from this that your school's intro programming class doesn't use C++. What language does it use?

As for pointers and C-strings, if your professor didn't say anything about them explicitly, I wouldn't worry about them. Maybe ask him about this if you want to make sure.

The brief description of the intro programming class says that the prof may choose any programming language. I emailed the professor and he said " Please REFRAIN from sending me other questions about C++.

Please DO NOT send me questions about C++ for now.

Please save up your questions and ask when we meet in August 2014.

And, this is the third informational reminder regarding "CIS 25 -- C++ Programming" class in the fall 2014 semester at Laney College.

To take my CIS 25, it is strongly recommended that you have the following (real) programming knowledge and practices (or, perhaps taking my CIS 6 class prior to my CIS 25):


0. Knowing programming styles and convention
1. Knowing what conditional structures are and how to use them
2. Knowing what loops are and how to use them
3. Knowing what FUNCTIONs are and HOW TO use them
4. Knowing FUNCTIONs really well and HOW TO use them
5. Knowing FUNCTIONs really WELL and HOW TO use them WELL
6. Knowing what arrays are and how to use them
7. Knowing arrays well and how to use them
8. Knowing arrays WELL and how to use them WELL
9. Feeling comfortable with learning about memory and memory
structures in programming -- You will be learning about this
concept and more

You can check out any recent C++ book(s) for information (any C++ books that are about 2011 or newer) -- Either online browsing or some book stores. I would advise you to look/browse/read and feel real comfortable with the book or books before considering the purchase -- Or you can wait until the class meeting in August.

Please take the advice and think carefully before taking CIS 25.

As for what else to be presented and learned in my class, you will be learning:

a. Polymorphism
b. Pointer and dynamic space
c. Classes
d. Inheritance
e. Template
f. Interesting applications coming from all above topics

And please do not reply to this message."
 
  • #10
You should really take the intro course to programming if you have no experience and are trying to catch up to take his course. If this were the late 90's into the early 2000's, you'd be able to without issues, but programming has advanced quite a bit since those days. The intro courses are designed for exactly that - an introduction with the basic concepts and such. If you don't understand any of what is in that list, don't try to rush your learning as you'll get confused and struggle to even stay "a little far behind".

Definitely keep on doing what you're doing with the self learning until you get into the intro class, so that will help you for sure, but to skip the introductory courses in anything, it usually requires a year or so of real world experience and/or 2+ years of experience and knowledge (experience from practice and writing beginner to intermediate level applications).

Just my $0.02 :)
 
  • Like
Likes 1 person
  • #11
elusiveshame said:
You should really take the intro course to programming if you have no experience and are trying to catch up to take his course. If this were the late 90's into the early 2000's, you'd be able to without issues, but programming has advanced quite a bit since those days. The intro courses are designed for exactly that - an introduction with the basic concepts and such. If you don't understand any of what is in that list, don't try to rush your learning as you'll get confused and struggle to even stay "a little far behind".

Definitely keep on doing what you're doing with the self learning until you get into the intro class, so that will help you for sure, but to skip the introductory courses in anything, it usually requires a year or so of real world experience and/or 2+ years of experience and knowledge (experience from practice and writing beginner to intermediate level applications).

Just my $0.02 :)


that's a good point. thanks
 
  • #12
jtbell said:
It appears from this that your school's intro programming class doesn't use C++. What language does it use?

As for pointers and C-strings, if your professor didn't say anything about them explicitly, I wouldn't worry about them. Maybe ask him about this if you want to make sure.

Jtbell, another question I have is that the book I'm self teaching myself off of was published in 2007. Do you think the fundamentals of programming have changed enough from then that I should get a newer edition of the book? How old is too old?
 
  • #13
I've now looked at the actual course listings at

http://www.laney.edu/wp/cis/computer-information-systems-courses/

CIS 25 (Object-Oriented Programming Using C++) definitely looks like it assumes the student is already fairly competent in traditional procedural programming, in something like C, the non-object-oriented subset of C++, Visual Basic, Python, or whatever.

Which language does your book use (the one that you're self-teaching out of)? And which book is it? If it's from 2007 it's probably out of print by now, but I might recognize the title or author(s).

So long as it actually has you designing and writing programs, and running them (or trying to :wink:), and debugging them to get them to actually work; and gets you comfortable with the basic programming structures (if-statements and loops), functions (subprograms) and arrays of data, it should work, in principle. However, you should expect to put in at least as much effort as it would take you to do well in either CIS 6 or 25.

I haven't taught that level of material since about 2005, but I seriously doubt that it's changed significantly since then. Things are always changing in the programming world, but the fundamentals at that level haven't, as far as I know. The material that your instructor is talking about is stuff that all programmers use. I was using that stuff in Fortran in the 1970s and 1980s, in Pascal in the 1980s and 1990s, and in C++ and Perl in the 1990s and 2000s.

The course that I taught was a 2-semester intro to programming that used C++. The first semester covered basic non-object-oriented stuff. The second semester was mostly the stuff that's in your CIS 25.
 
Last edited:
  • #14
jtbell said:
I've now looked at the actual course listings at

http://www.laney.edu/wp/cis/computer-information-systems-courses/

CIS 25 (Object-Oriented Programming Using C++) definitely looks like it assumes the student is already fairly competent in traditional procedural programming, in something like C, the non-object-oriented subset of C++, Visual Basic, Python, or whatever.

Which language does your book use (the one that you're self-teaching out of)? And which book is it? If it's from 2007 it's probably out of print by now, but I might recognize the title or author(s).

So long as it actually has you designing and writing programs, and running them (or trying to :wink:), and debugging them to get them to actually work; and gets you comfortable with the basic programming structures (if-statements and loops), functions (subprograms) and arrays of data, it should work, in principle. However, you should expect to put in at least as much effort as it would take you to do well in either CIS 6 or 25.

I haven't taught that level of material since about 2005, but I seriously doubt that it's changed significantly since then. Things are always changing in the programming world, but the fundamentals at that level haven't, as far as I know. The material that your instructor is talking about is stuff that all programmers use. I was using that stuff in Fortran in the 1970s and 1980s, in Pascal in the 1980s and 1990s, and in C++ and Perl in the 1990s and 2000s.

The course that I taught was a 2-semester intro to programming that used C++. The first semester covered basic non-object-oriented stuff. The second semester was mostly the stuff that's in your CIS 25.

Wow! Thanks for taking the effort and time to look up the class at my school! :D The book I'm using to self-teach off of is by Y.Daniel Liang. This is the 3rd edition of the book (i'm using the first edition version) https://www.amazon.com/dp/0133252817/?tag=pfamazon01-20
 
Last edited by a moderator:
  • #15
A Google search led me to info about the book on the author's web site:

http://www.cs.armstrong.edu/liang/cpp3e/toc.html

and on the publisher's web site:

http://www.pearsonhighered.com/educ...tion-to-Programming-with-C/9780133252811.page

It looks like Part I covers the material you need. And it does C++ style strings before C-strings. :thumbs:

Be sure to do lots of programming exercises! Programming is a skill, and skills can be developed only by practice. You need to get to the point where the basic mechanics of writing and running programs (in whatever programming software you're using) come naturally and you can focus on the details of the programs themselves.
 
  • #16
jtbell said:
It looks like Part I covers the material you need. And it does C++ style strings before C-strings. :thumbs:

Oops, I forgot you're using the first edition:

http://www.pearsonhighered.com/educator/academic/product/0,,0132320495,00%2ben-USS_01DBC.html

http://www.cs.armstrong.edu/liang/cpp/c++instructor.html

It doesn't look like it uses C++ style strings, only C-strings, except maybe later in Part II.
 
Last edited by a moderator:
  • Like
Likes 1 person
  • #17
jtbell said:
Oops, I forgot you're using the first edition:

http://www.pearsonhighered.com/educator/academic/product/0,,0132320495,00%2ben-USS_01DBC.html

http://www.cs.armstrong.edu/liang/cpp/c++instructor.html

It doesn't look like it uses C++ style strings, only C-strings, except maybe later in Part II.

thank you very much, jtbell! :biggrin:
 
Last edited by a moderator:

Related to What topic is "conditional structures" under?

1. What is the definition of "conditional structures"?

Conditional structures refer to a programming concept that allows for different sets of instructions to be executed depending on whether a certain condition is met or not.

2. Is "conditional structures" a topic in computer science or mathematics?

Conditional structures are primarily a topic in computer science, specifically in the field of programming and software development.

3. What are some examples of conditional structures in programming?

Some examples of conditional structures include if statements, switch statements, and ternary operators. These allow for different actions to be taken based on the evaluation of a condition.

4. Are conditional structures only used in specific programming languages?

No, conditional structures are a fundamental concept in programming and can be found in many different programming languages, including Java, Python, C++, and more.

5. How can understanding conditional structures improve my programming skills?

Understanding conditional structures can improve your programming skills by allowing you to write more efficient and logical code. By using conditional structures, you can create programs that can handle different scenarios and make decisions based on specific conditions.

Similar threads

  • Programming and Computer Science
Replies
7
Views
717
  • Programming and Computer Science
Replies
15
Views
1K
  • Programming and Computer Science
2
Replies
69
Views
4K
  • Programming and Computer Science
Replies
5
Views
1K
  • Programming and Computer Science
Replies
5
Views
5K
  • Programming and Computer Science
2
Replies
58
Views
3K
  • Programming and Computer Science
Replies
13
Views
2K
Replies
10
Views
1K
  • Programming and Computer Science
Replies
6
Views
1K
  • Programming and Computer Science
Replies
26
Views
5K
Back
Top