Help me in c++ programming

This is a discussion on Help me in c++ programming within the C++ Programming forums, part of the General Programming Boards category; PLEASE HELP ME IN THIS C++ PROGRAMMING Question 1; Write a program that convert form 24-hour notation to 12-hour notation. ...

  1. #1
    Registered User
    Join Date
    Jan 2009
    Posts
    1

    Lightbulb Help me in c++ programming

    PLEASE HELP ME IN THIS C++ PROGRAMMING


    Question 1;
    Write a program that convert form 24-hour notation to 12-hour notation. For example, it should convert 14:25 to 2:25 PM. The input is given as two integers. There should be at least three functions, one for input, one to do the conversion, and one for output. Record the AM/PM information as a value of type char, A for AM and P for PM. Thus, the function for doing the conversions will have a call-by reference formal parameter of type char to record whether it is AM or PM (The function will have other parameters as well.). Include a loop that lets the user repeat this computation for new input values again and again until the user says he or she wants to end the program.





    Question 2;
    Write a program that requests the current time and a waiting time as two integers for the number of hours and the number of minutes to wait. There should be at least three functions, one for input, one to do the conversion, and one for output. Record the AM/PM information as a value of type char, A for AM and P for PM. The program then outputs what the time will be after the waiting period. Use 12-hour notation for the times. Include a loop that lets the user repeat this calculation for additional input values until the user says she or he wants to end the program.






    Question 3;
    Write a program that requests the user to enter start-time and end-time in 12-hour notation for an event. The system will calculate the duration of the event and display the duration time as two integers for the number of hours and the number of minutes. Include a loop that lets the user repeat this calculation for additional input values until the user says she or he wants to end the program.

  2. #2
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    22,304
    What have you tried?
    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

  3. #3
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,852
    Maybe YJCHONG should begin by trying to read this
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  4. #4
    3735928559
    Join Date
    Mar 2008
    Location
    RTP
    Posts
    839
    the answer is 42

Popular pages Recent additions subscribe to a feed

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