Need help with C++ samples. Basic intro stuff. Thanks

In summary, the conversation discusses the need for resources and sample code for basic loop tasks and loop control, as well as a function that returns a given value. Links to helpful tutorials are provided, and there is a question about writing a program to read input and output the average of marks above 10. The conversation ends with a suggestion to use the cctype library to count characters.
  • #1
nukeman
655
0

Homework Statement



I am getting ready for a midterm, and I got a list of stuff to study for the exam. Since I was put into the class late, I missed some intro stuff.

Can some of you, whom probably know some good resources, give me a link or show me a sample code of the following: ?

Basic loop task for 1) counting 2) summing 3) finding maximum

Basic type of loop control: 1) sentinel style 2) counted 3) end of file (eof)

Most important, which I can't find a sample code of:

Write a function that returns... given...

Is there any tutorials that can show a program that would read marks from standard input and output the average of the marks that are 10 or higher.

Does not have to be that specific, but I am not sure how to write that code. Any links or help with that one?


Homework Equations





The Attempt at a Solution

 
Physics news on Phys.org
  • #2
nukeman said:

Homework Statement



I am getting ready for a midterm, and I got a list of stuff to study for the exam. Since I was put into the class late, I missed some intro stuff.

Can some of you, whom probably know some good resources, give me a link or show me a sample code of the following: ?

Basic loop task for 1) counting 2) summing 3) finding maximum

Basic type of loop control: 1) sentinel style 2) counted 3) end of file (eof)

Most important, which I can't find a sample code of:

Write a function that returns... given...

Is there any tutorials that can show a program that would read marks from standard input and output the average of the marks that are 10 or higher.

Does not have to be that specific, but I am not sure how to write that code. Any links or help with that one?


Homework Equations





The Attempt at a Solution


Don't you have a textbook?
 
  • #3
NOPE! My prof decided not to use one. So, if you are lucky enough to be able to SCRAMBLE down huge chuncks of code during lecture, and are able to read his writing, you will be fine. But for 99% of the class, its kinda silly if you ask me. Lots of complaints.

:(
 
  • #5
Great sites, thanks!

Mark or anyone else... I can't seem to find a sample simple code in C++ that basically the user inputs some characters like sdf sdf sdf, and the program counts them, and cout's how many characters the user typed in?

Any help?

Thanks so much!
 
  • #6
?

:)
 
  • #7
Umm the best thing you can do is use the cctype library. Using a while loop, receive characters and increment the counter.
 

FAQ: Need help with C++ samples. Basic intro stuff. Thanks

What is C++?

C++ is a high-level, general-purpose programming language that was created in 1983. It was developed as an extension of the C programming language and is commonly used for developing operating systems, games, and other complex applications.

How can I get started with learning C++?

To get started with learning C++, you can find online tutorials, enroll in a course, or read books on the subject. It is important to have a good understanding of basic programming concepts before diving into C++.

Can you recommend any resources for C++ beginners?

Some resources that may be helpful for beginners include "The C++ Programming Language" by Bjarne Stroustrup, "C++ Primer" by Stanley B. Lippman, and "C++ for Dummies" by Stephen R. Davis. Online resources such as Codeacademy and Coursera also offer courses on C++.

What are some basic concepts I should know in C++?

Some basic concepts in C++ include variables, data types, control structures (such as if/else statements and loops), functions, and arrays. It is also important to understand object-oriented programming principles, as C++ is an object-oriented language.

Can you provide any sample code for basic C++ programs?

There are many online resources that provide sample code for basic C++ programs, such as Code samples, GeeksforGeeks, and C++ Tutorial Point. It is also helpful to practice coding on your own and experiment with different concepts to solidify your understanding.

Similar threads

Replies
15
Views
2K
Replies
13
Views
3K
Replies
6
Views
3K
Replies
15
Views
2K
Replies
5
Views
2K
Replies
11
Views
3K
Replies
2
Views
1K
Back
Top