esign a program that reads a file called sales.txt containing the following data: ane, 215.5, 445.5,910.0 ohn, 825.0,250.5,675.0 ill,0.0,999.15 ach line has a employee's name and their weekly sales totals all separated by commas. Some employees have taken vacation some weeks so no numbers are aptured for those weeks. Create a function that takes a list of floats and returns the average value for those numbers. After reading the information from the file se a for loop to calculate the sales average using your new average function for each employee and display the following output to the screen. ane, average sales: 523.67 ohn, average sales: 583.50 ill, average sales: 499.56
esign a program that reads a file called sales.txt containing the following data: ane, 215.5, 445.5,910.0 ohn, 825.0,250.5,675.0 ill,0.0,999.15 ach line has a employee's name and their weekly sales totals all separated by commas. Some employees have taken vacation some weeks so no numbers are aptured for those weeks. Create a function that takes a list of floats and returns the average value for those numbers. After reading the information from the file se a for loop to calculate the sales average using your new average function for each employee and display the following output to the screen. ane, average sales: 523.67 ohn, average sales: 583.50 ill, average sales: 499.56
C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter6: Modularity Using Functions
Section: Chapter Questions
Problem 4PP
Related questions
Question
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 4 steps with 2 images
Knowledge Booster
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.Recommended textbooks for you
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,