[ 3 / biz / cgl / ck / diy / fa / ic / jp / lit / sci / vr / vt ] [ index / top / reports ] [ become a patron ] [ status ]
2023-11: Warosu is now out of extended maintenance.

/sci/ - Science & Math


View post   

File: 172 KB, 752x630, CPPin4days.png [View same] [iqdb] [saucenao] [google]
2187203 No.2187203 [Reply] [Original]

Hey /sci/, I was wondering if any of you anons could give me some sample C++ problems to do. I'm holding a session with some noobs, and I'm not sure what kinds of problems would be appropriate. I'd like to have a set of problems whose difficulty increases. I've already assigned them a quadratic equation solver for real and nonreal roots.

tl;dr: C++ problems needed, answers optional but preferred. Thanks, /sci/.

>> No.2187209

http://projecteuler.net/ to the rescue!

>> No.2187218

>I'm holding a session with some noobs
>Exactly one person at the session
>Including OP

>> No.2187225

>>2187218

It's funny because it's not true.
BTW, your syllogism falls apart at the "Exactly one person at the session". There are about 20-25 c++ newfags coming.

>> No.2187236

>>2187225
Tell them how overrated shit C++ is.

>> No.2187246

>>2187236
Or maybe I could do what they're paying me to do--teach them C++. They have most of the basics down, so I've gotta give them problems to solve, and i think project euler might be a bit beyond their reach right now. They could try stuff from there maybe the next time.

Come on, computer /sci/entists, help an anon out.

>> No.2187275

>>2187246
Make them write a program the returns the character that appears the most in a string.
Make them write a program that will print a triangle. For example, if the input is 5, the program will print:
4
42
424
4242
42424

>> No.2187294

>>2187275
Actually you can simplify the first problem: the input is a DNA sequence consisting of only the characters A, T, G and C. The program then outputs the nucleotide that appears the most in the sequence.
Example:
Input: ATTGCCATATCC
Output: C

>> No.2187296

>>2187225
>newfags
Holy fuck, could you get any more annoying?

>> No.2187309

>>2187294
Oh and if two characters appear the same amount of times in the string, print the one that is first alphabetically.

>> No.2187349

here is a challange
it's a program that counts to 100
every three numbers it should return "pop"
every five numbers it should return "bang"
every time those interwiene it should return "bangpop"
having it return a empty string is unacceptable.

this should take less than 10 minutes, but it is a problem that you learn a lot from solving.

>> No.2187358

>>2187349
>program
>returns
>100 times
Stop using terminology incorrectly.

>> No.2187373
File: 102 KB, 1280x1115, 1289089253420.jpg [View same] [iqdb] [saucenao] [google]
2187373

>>2187358

>> No.2187387

>>2187358

lol okay

>> No.2187391

whatever you do OP, make it fucking interesting, and not like the courses I took

btw I'm in comp sci III so I'm pretty good at programer now