Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In C++ language, C++ Programming - Calculate hours worked Suppose a log file has been created to keep track the hours worked by a programmer.

In C++ language,

C++ Programming - Calculate hours worked

Suppose a log file has been created to keep track the hours worked by a programmer. The log contains at most 100 entries. Each entry consists of two columns. The first column is a date and the second represents hours to be billed for that day of work. Assume the log was saved as a disk text file (c:\temp\myloghours.txt)

Dec-30-2018 30 Dec-31-2018 5 Jan-01-2019 20 Jan-02-2019 15 Jan-21-2019 7 Feb-03-2019 43 Feb-04-2019 44

Write a C++ program to read a log file similar to the above disk file and calculate the total hours worked, as well as the monthly sub-totals. For instance, a possible output rendition for the program could be as shown below

Total hours: 165 Dec 35 Jan 42 Feb 87

Create a disk file with the sample data provided here (you may use Notepad or a similar text app).

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Relational Database Design With Microcomputer Applications

Authors: Glenn A. Jackson

1st Edition

0137718411, 978-0137718412

Students also viewed these Databases questions