2 simple C++ probs
I everyone, im trying to solve these 2 questions. n have a look if I got the right answer for u guys.
this has been the 1st time I learn C++ and a lot of stuff I dont understand. cheers.
A
---------------
question1 :
Write a C++ program that inputs date, month from user in the format DD/MM and outputs in format DDth/DDrd/DDst/DDnd of <MONTH NAME> for year 2009 only.
Sample outputs:
Run 1:
Enter date (DD/MM): 14/07
14th of July
Run 2:
Enter date (DD/MM): 3/12
3rd of December
--------------------------
question 2:
Write a C++ program that inputs user’s name (first and last), gender and marital status and greets him/her accordingly as (Mr./Ms./Mrs.) followed by family name (You can assumed that gender is entered as ‘m’ or ‘f’ and marital status as ‘y’ or ‘n’).
Sample outputs:
Run 1:
Name: Julia Styles
Gender: f
Married: n
Hello Ms. Styles
Run 2:
Name: Mary Jacobi
Gender: f
Married: y
Hello Mrs. Jacobi
--------------------------
my answer to question 1( : S )
thanks guys.
A