Creating a c++ program asking the user to enter a date in the format DD MM YYYY?
-
Given a date of format DD MM YYYY where YYYY >= 2000, write a C++ program to: 1. Find the next date (you may ignore the special case of leap years). 2. Calculate your age up to the given date. 3. Check if the same date DD MM has passed or not in the current year. If not calculate how many days are left. Your program must validate the given date and display an appropriate message if it is not valid. Thank you in advance. I started with #include < iostream > but i'm not sure if this is enough, shall I add something to it? maybe < iomanip >?! and then using namespace std; main () { int dd; int mm int YYYY; ^ this is where I declared the variables. & then: cout<< " Enter Date In The Format (dd mm YYYY): "; //Accept Entire Date cin>>dd; cin>>mm; cin>>YYYY; and then for the validation i chose to use if statement (since i'm asked to use either if or else statement and the while loop statement for this assignment) this way { if(YYYY < 2000) cout << "enter a valid value for YYYY"; return 0; } and then I wasn't sure what does Find the next date mean. i thought it may mean the day that comes after the date the user enters? so in that case we will have an increment dd++ for the value of the day dd for 2.calculate your age i did not know what function to use to calculate the age. So if you could help me you'd be doing me a HUGE favor. Thanks!
-
Answer:
ââââââââââââââââââââââââââââââââââââââ⦠âââââââââ(@)(@)> RELAX <(@)(@) âââââââââ ââââââââââââââââââââââââââââââââââââââ⦠â(@)âââââââ(@)(@)âââââââââââââââââââ(@â¦
Sara at Yahoo! Answers Visit the source
Related Q & A:
- How to Convert a C++ Structure into C# Structure?Best solution by Stack Overflow
- How Can I use .net dll in C program?Best solution by Stack Overflow
- How to change the date format yyyy/mm/dd to dd/mm/yyyy in below code?Best solution by scn.sap.com
- How to run an executable from within a c program?Best solution by Stack Overflow
- Can anyone help me with this C++ program?Best solution by Yahoo! Answers
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.