Quantcast
Channel: Date manipulation question
Viewing all articles
Browse latest Browse all 20

Date manipulation question

$
0
0
>we are not at that point in class so I can't use some
>of that code.

This is *one* of the problems with asking for help with
course assignments in a public forum. We have no way of
knowing what has or hasn't been covered in the course.

Even if we did, it's *your* assignment so you need to do it
yourself. If the teacher wanted a collaborative or group
effort then everyone in the course could sit down together
and create a single program to be submitted by every student.
While that might make the teacher's job easier - having only
one program to grade - it would not be a very good way to
teach students how to program by themselves.

>I know most of the code I need to use I am not sure of how to
>actually impliment it

Then start coding - you'll learn from your mistakes what
will or won't work. As you refine your approach the task
should become clearer.

>or how I pass the mm/dd/yyyy to the function  

Any way you want. You obviously already know how to pass a
std::string to a function, since you did it in your earlier
code.

>or whether I do the conversion in the main

That's a design decision which you as the programmer must
make yourself.

>and how I return the new string as month being a word.

You should already know how to return a value from a
function. You also should already know how to pass more
than one argument to a function, including pointers and
references.

Break the program down into discrete parts which can be
coded as more or less independent sub-tasks. Then focus
on coding one part of the program (a sub-task) and getting
it to work. Eventually you will have all of the separate
tasks coded and you can then cobble them together to get
the final complete program. Think modularly rather than
trying to construct the entire program in your mind
before writing any code.

- Wayne


Viewing all articles
Browse latest Browse all 20

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>