Could anyone help me with my c++ programming homework?
text is read from a file, user enters it's name.
need to print out all uppercase letters if there are more of them than lowercase ones, print each letter only once
otherwise print out all numbers in the text.
If the shortest and the longest lines character number sum in larger than a number that the user entered - print out how many lines there is in the text and average length of them.
If in a line the 2nd word's 3rd letter is an uppercase - calculate how many words are there in that line that start in lowercase, otherwise switch the shortest word with the longest one.
If in a line there are more words than the user's entered number - remove the 1st uppercase word from that line, otherwise the user enters where he wants to insert a word (enters the word himself and the position).
I don't necessarily need the entire program but just to get me started.
>>217361
no one cared who he was until he collected all 12 kanohi
>>217361
your post was confusing as fuck, is that your idea or the actual homework?
it doesn't sound too complex, just count the ascii codes to find uppercases and spaces, and then find out which option you want with an if, or a switch depending on which is true. Use booleans for that.
i don't even C++ but im pretty sure it uses conditionals and booleans, right?
now go do your own fucking homework
>>217512
It looks like an examination-style homework, rather than a learn-by-doing-style homework.
That's why the program does a bunch of things that are complicated and non-useful.
The examiner will have a test harness, that can run the code through a bunch of edge-cases, and mark it automatically.
OP should be applying what he learned earlier in the course, had he been paying attention.
If OP makes an honest stab at it, he'll get at least one answer to any specific question he asks, coming from someone who could write that in his sleep.
If OP wants his homework done for him, he'd better hope someone more charitable comes along.
>>217516
i just want a basis to start with, like how do i check each line individually for a start
i know most of that, what is needed to do but i want either a good source to learn this or some sort of a starter, since what my teacher gave me is less than bare bones
>>217512
>i don't even C++ but im pretty sure it uses conditionals and booleans, right?
C doesn't have booleans.
In C, if something equals zero, it's false, and if it doesn't, it's true.
So if your char is guaranteed to only contain ASCII letters, then !(mychar&&0x20) is true if your char is upper-case.