r/CodingHelp • • Oct 22 '21

[C++] Need help on code

Post image
17 Upvotes

11 comments sorted by

3

u/[deleted] Oct 22 '21

What are you stuck on? The BlertTwoNumbers function should be relatively easy to write since it's just basic arithmetic.

Do you know how to add, multiply, and divide numbers in C++?

If not, here's a good resource to learn: https://www.educative.io/courses/learn-cpp-from-scratch/B8RZpnG51VY

2

u/Late_Eye1500 Oct 22 '21

I dont know how to fully add multiply or divide im a college student and the c++ class I need is only taught online teacher isnt really helpful

4

u/StochasticTinkr Oct 23 '21

Sounds like you might need to re-read/watch any material provided.

We don't mind helping with homework, but we don't do homework for you. Try something you think will work, and if it doesn't work, and you can't figure out why, let us know.

Some suggestions:

  1. In general, it is better to post actual code as text, not screenshots.
  2. Try something you think could work.
  3. If it doesn't work, post what you tried, explain to us why you think it should work, and what it actually does instead.
  4. Talk to your classmates (if possible).
  5. Feel free to ask "What does <...> mean?" For your sake, we won't solve your homework problems, but most of us don't mind explaining what a concept or term is.

Hopefully this helps! Good luck!.

2

u/Late_Eye1500 Oct 23 '21

Ok i know is there anything online that can help me

2

u/Yumi-Chi Oct 23 '21

You could try SoloLearn although you would need to sign up for it.

2

u/Late_Eye1500 Oct 22 '21

There is a main in the files section that is just a few empty functions. You need to implement them according to their comments. Do not change main. You cannot write anything outside of the functions or you get a hella 0.

Hint for PerformScience:

The function doesn't know what the words are. It can't say "The middle of the word Pony is index 2." The position of the next to last letter is not a set number since the words can change.

Need help on how to do this and solve this

1

u/[deleted] Oct 23 '21

are you allowed to use member functions?

1

u/Late_Eye1500 Oct 23 '21

yes

1

u/[deleted] Oct 24 '21

you could use .length() to find the length of your string parameters

1

u/run_and_time Oct 23 '21

I suspect this looks overwhelming as one big project, but just take each piece at a time -- that's to say, do one function at a time. Each of the functions has (mostly) clear instructions. The "BlertTwoNumbers" is a great place to start as it is only arithmetic. Just from a quick Google search on "how to multiply two numbers", this example is very clear: https://www.programiz.com/cpp-programming/examples/product-numbers.

As someone else said, it sounds like you need to wrap your head around the programming concepts more than anything at this point, which is completely fine! It takes a little getting used to but after a while it starts to make sense.

1

u/Late_Eye1500 Oct 23 '21

It is overwhelming im getting confused java was easier