i have an assignment in my computer science class. i have to write a program that takes in the expiration date of a food product, the current date, and tells whether or not the product is expired or not.
i have to use 3 bool functions ( 'isvalid' returns if a date is valid, has parameters that represent one date) ( 'thesame' tells if the two dates are the same, has parameters that represent two dates) ( 'earlier' returns true if the first date is earlier than the second date and false otherwise, has parameters that represent two dates) and a void function ( 'output_date' which takes parameters that represent one date and outputs it to the screen)
here is the output:
Enter expiration date in the form mm/dd/yyyy: 2/1/2017
Enter today's date in the form mm/dd/yyyy: 2/15/2013
The expiration date you entered is 2/01/2017
The current date you entered is 2/15/2013
The expiration date is later than today, this food is ok!
i just need help writing a bool function. idk how to make one
2007-03-19
10:17:24
·
4 answers
·
asked by
63godtoh
3
in
Computers & Internet
➔ Programming & Design
this goes out to Rex M who left the first comment.
could you be a little more vague? i said i do not know how to write them, thats not even showing me how to write it, its just giving a general idea, i said i need help because i dont have the slightest clue how to write a bool function
would someone please give me like a full example of a bool function, and before you answer, look at what Rex M put and hear me when i say 'that was way to vague of an answer for me to understand'
2007-03-19
10:28:17 ·
update #1
ok just so people dont keep saying "rex m's' answer is detailed, what are you talkin about!"
before his answer was in two lines and it didnt help me because it was very vague, i dont care what anyone says. coming from someone who says they dont know much about it i can tell you that it was very vague.
but then after i said that, he went back and added more detail into his answer, but stupid yahoo answers wont let you know that, so it looks like he put all that stuff in the first time when he didnt
...also i forgot to mention im working in C++ and thats what my teacher wants us to use so this whole page is completely useless to me now
2007-03-20
09:29:08 ·
update #2