Zodiac Program

Oct 28, 2021 at 2:21am
SOLVED
Last edited on Oct 31, 2021 at 3:35am
Oct 28, 2021 at 3:26am
if you know arrays, make an array that matches up..
string monthnames[13] {"invalid", "January",...
and monthnames[10] gives you back "october"

without that, you can do what you did already, a bunch of conditions .. if month == 10 stringmonth = "October" ... or similar logic.
Oct 28, 2021 at 9:20am
Hi,

I think there is a better way of doing this:

Create a std::vector or an array of struct with this info as an example:

12,22,"saggitarius","capricorn" // similar for other months

Use that info to write your code.

At the moment, your code has to go through the entire logic to get to capricorn, the method I am thinking of will be easier.

I will leave up to you to figure out how to do it.
Oct 29, 2021 at 5:22am
thank you sooo muchhh :>>
Nov 1, 2021 at 1:57pm
@raveneightttt

Please do NOT remove your questions once you've gotten an answer. It makes the thread useless as a learning resource for other posters.
Nov 1, 2021 at 2:03pm
@mikeyBoy, this is the OP's 2nd thread, and both are now trashed. I do believe he's another help thief. And troll.
Nov 1, 2021 at 6:15pm
Someone reported him, so he should disappear in a bit.
Topic archived. No new replies allowed.