CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2011
    Posts
    2

    Exclamation [HELP] Program that computes the daily wage of an Employee

    Problem Description.

    You are hired by a small company to create a program that computes the daily wage of its employees.

    The employees are required to time-in when they arrive to work and time-out when they leave work.

    The company's regular working hours is from 8 A.M. to 5 P.M.

    Lunch break, which is mandatory, is from 12:00 noon to 1 P.M. During lunch break, the company closes its office and forces every employee to eat lunch. The employees are not required to time-out and time-in during the lunch break.

    There is no early time-in. Any time-in before 8:00 A.M. is considered as coming in at exactly 8:00 A.M.

    Over-time is considered only if the employee has already worked for at least 8 hours.

    The regular hourly wage of the company for all employees is 40 pesos. The overtime hourly wage for all employees
    is 60 pesos.

    Problem Specification.

    Create a C++ program that computes the daily wage of the company's employees.
    The program asks for the time-in and time-out information of an employee. The input will be four numbers separated by
    a space (or a newline). The first two numbers correspond to the time the employee arrived. The last two numbers correspond the time the employee left for the day.
    For example if the employee arrived at 8:30 A.M. and left at 5:15 P.M., the input is 8 30 5 15

    The program prints as its output the following:
    1) the employee's total regular working hours
    2) the employee's total overtime
    3) the daily regular wage
    4) the daily overtime wage
    5) the daily total wage (regular + OT)


    I have been going at this for a week now but I really can't solve it. I'll fail my course if I don't get this problem. I'd be very very very grateful to anyone who can help me solve this problem. Hints? Clues?

  2. #2
    Join Date
    Aug 2009
    Posts
    440

    Re: [HELP] Program that computes the daily wage of an Employee

    What have you tried?

  3. #3
    Join Date
    Nov 2003
    Location
    Belgium
    Posts
    8,150

    Re: [HELP] Program that computes the daily wage of an Employee

    Like Alterah said, post your current code and tell us where you are having problems.
    Marc Gregoire - NuonSoft (http://www.nuonsoft.com)
    My Blog
    Wallpaper Cycler 3.5.0.97

    Author of Professional C++, 4th Edition by Wiley/Wrox (includes C++17 features)
    ISBN: 978-1-119-42130-6
    [ http://www.facebook.com/professionalcpp ]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured