2 simple C++ probs

This is a discussion on 2 simple C++ probs within the C++ Programming forums, part of the General Programming Boards category; 2 simple C++ probs I everyone, im trying to solve these 2 questions. n have a look if I got ...

  1. #1
    Registered User
    Join Date
    Mar 2009
    Posts
    2

    2 simple C++ probs

    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 users 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

  2. #2
    Registered User
    Join Date
    Mar 2009
    Posts
    2
    i dont know how to post my answer, it says code tag or somethin.

    can anyone gimme a right solution to these 2,
    many thanks

    A

  3. #3
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    21,598
    Quote Originally Posted by alikoolg
    i dont know how to post my answer, it says code tag or somethin.
    That is, post your code in [code][/code] bbcode tags, e.g.,
    Code:
    [code]#include <iostream>
    
    int main()
    {
        std::cout << "Hello world!" << std::endl;
    }[/code]
    C + C++ Compiler: MinGW port of GCC
    Version Control System: Bazaar

    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  4. #4
    Registered User
    Join Date
    Apr 2008
    Posts
    890
    Quote Originally Posted by alikoolg View Post
    can anyone gimme a right solution to these 2,
    It's right here.

  5. #5
    Or working on it anyways mramazing's Avatar
    Join Date
    Dec 2005
    Location
    Lehi, UT
    Posts
    121
    Have you tried to solve them? You should give them a shot. You might be able to do more than you think.
    -- Will you show me how to c++?

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. creating very simple text editor using c
    By if13121 in forum C Programming
    Replies: 9
    Last Post: 10-19-2010, 05:26 PM
  2. Simple message encryption
    By Vicious in forum C++ Programming
    Replies: 10
    Last Post: 11-07-2004, 10:48 PM
  3. Binary Search Trees Part III
    By Prelude in forum A Brief History of Cprogramming.com
    Replies: 16
    Last Post: 10-02-2004, 03:00 PM
  4. Simple simple program
    By Ryback in forum C++ Programming
    Replies: 10
    Last Post: 09-09-2004, 05:48 AM
  5. Need help with simple DAQ program
    By canada-paul in forum C++ Programming
    Replies: 12
    Last Post: 03-15-2002, 07:52 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21