Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

A text file GroceryData . txt contains grocery shopper names and the amount they spent on their groceries for each trip to the grocery store

A text file "GroceryData.txt" contains grocery shopper names and the amount they spent on their groceries for each trip to the grocery store this month. For example: the first line contains "Carol,35.00,67.00,13.00". Which means Carol went to the grocery store 3 times this month and spent $35, $67, and $13. Calculate the average grocery bill for each shopper for the month. Keep in mind that some shoppers have more visits than others so make sure your code uses every trip for each shopper in its calculations. Print the results out to the screen in the following format with each shopper on a new line: "Name: Carol, Average: 38.33333"

Data in text file should be:

Carol, 35.00,67.00,13.00

Steve, 14.00,82.00,41.00,66.00

Sharon, 56.00,42.00,28.00,70.00

Roy, 80.00,105.00,55.00

Beatrice, 20.00

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

Database Basics Computer EngineeringInformation Warehouse Basics From Science

Authors: Odiljon Jakbarov ,Anvarkhan Majidov

1st Edition

620675183X, 978-6206751830

More Books

Students also viewed these Databases questions

Question

6. Identify characteristics of whiteness.

Answered: 1 week ago