et of data where each row represents a day of the week and each entry on the row represents a block of time worked, like this: 1.5h 3.25h 8.eh 6.0h 1.On 5. 5h 2.25h e.75h 2.25h 3.0h 3.en 5.75h 2.25h report could be produced by a program like this: 0.00h 0.00h 5.25h 1.50n 3.25h e.seh 10.e0h | 3.0en 6.00h 1.een 8.50h 8.25h 8.00h i 5.75h 2.25h e.00h | e.e0h 5.5eh 2.25h 0.75h 2.25h 3.00h 3.00h leekly Total: 40.00h otice how in the output file all the numbers are nicely formatted as right-aligned. Hint: you will probably need to use splitting, string.slicing, converting data pes, and string formatting.

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter7: Arrays
Section7.5: Case Studies
Problem 8E
icon
Related questions
Question
2. [summary_report.py] Timesheet data is easy to represent in a file, where it can be used to generate a report and help the worker get paid! Given an example
set of data where each row represents a day of the week and each entry on the row represents a block of time worked, like this:
1.5h 3.25h
3.8h 6.Oh 1.eh
5. 5h 2.25h 0.75h
2.25h 3.0h 3.0h
5.75h 2.25h
A report could be produced by a program like this:
0.00h |
5.25h | 1.5en 3.25h 0.5eh
10.00h
0.00h
3.00h 6.00h 1.00h
8.50h
5.50h 2.25h 8.75h
8.25h
8.00h
0.00h | e.00h
2.25h 3.00h 3.00h
5.75h 2.25h
Weekly Total: 40.00h
Notice how in the output file all the numbers are nicely formatted as right-aligned. Hint: you will probably need to use splitting, string slicing, converting data
types, and string formatting.
create a program that uses a data file that you have created, parses the data in that file to create a calculation per row and a running
total, then writes the report to an output file. Your program should prompt a user to input a file containing the data, then prompt the user to enter a file name
for outputting the report and the total, formatted similarly to the example above. Here is an example interaction for our timesheet example:
Enter timesheet file name: mcbride_timesheet_20210606.txt
Enter name for report file: mcbride_timereport_20210606.txt
Done writing totals to mcbride timereport_20210606. txt
Transcribed Image Text:2. [summary_report.py] Timesheet data is easy to represent in a file, where it can be used to generate a report and help the worker get paid! Given an example set of data where each row represents a day of the week and each entry on the row represents a block of time worked, like this: 1.5h 3.25h 3.8h 6.Oh 1.eh 5. 5h 2.25h 0.75h 2.25h 3.0h 3.0h 5.75h 2.25h A report could be produced by a program like this: 0.00h | 5.25h | 1.5en 3.25h 0.5eh 10.00h 0.00h 3.00h 6.00h 1.00h 8.50h 5.50h 2.25h 8.75h 8.25h 8.00h 0.00h | e.00h 2.25h 3.00h 3.00h 5.75h 2.25h Weekly Total: 40.00h Notice how in the output file all the numbers are nicely formatted as right-aligned. Hint: you will probably need to use splitting, string slicing, converting data types, and string formatting. create a program that uses a data file that you have created, parses the data in that file to create a calculation per row and a running total, then writes the report to an output file. Your program should prompt a user to input a file containing the data, then prompt the user to enter a file name for outputting the report and the total, formatted similarly to the example above. Here is an example interaction for our timesheet example: Enter timesheet file name: mcbride_timesheet_20210606.txt Enter name for report file: mcbride_timereport_20210606.txt Done writing totals to mcbride timereport_20210606. txt
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Random Class and its operations
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
Systems Architecture
Systems Architecture
Computer Science
ISBN:
9781305080195
Author:
Stephen D. Burd
Publisher:
Cengage Learning