Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C++ Turbo

write a program in c++ to calculate the remaining days of my birthday in current days
Posted 12-Jan-13 23:58pm
Comments
Pravinda Amarathunge at 13-Jan-13 5:37am
   
Your question Totally doesn't make any sense : "Computer Science Department" !
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

We do not do your homework: it is set for a reason. It is there so that you think about what you have been told, and try to understand it. It is also there so that your tutor can identify areas where you are weak, and focus more attention on remedial action.
 
Try it yourself, you may find it is not as difficult as you think!
  Permalink  
Comments
SajeeshCheviry at 13-Jan-13 7:38am
   
Good answer
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

WELL people here certainly dont do your homework...but to get you started,here is the problem broken,now go figure it out
1.get your birthday as input
2.taking the above input,calculate the date as numbered day of year eg like 205 th day of year...
3.then check,using above number and current numbered day(i.e today's date convereted to numbered day of year) whether you have passed your birthday date or it is yet to appear.
4.after this simply return the value,which will be your answer
 
Well i'm helping you cause some time back even i was afraid of coding,but let me be clear,HANDS ON makes you perfect so code...Big Grin | :-D
 
I hope other guys wont be angry on me for helping him with his homework...
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

There are just two tricky details in you task, namely
  1. Wrap around.
  2. Leap years.
For simplicity, let's suppose that neither wrap around nor leap year case is happening then, with just an array (days per month) and simple operations you may easily find the result.
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



Advertise | Privacy | Mobile
Web04 | 2.8.1411022.1 | Last Updated 14 Jan 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100