Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

double calculate _ bill ( char * in _ file, char * customer ) ; This function will open the file named in file, read

double calculate_bill(char *in_file, char *customer);
This function will open the file named in file, read the data, and calculate and return the
bill of the customer specified by customer. In case of errors, your function should return an
appropriate error code as described in section 4.4.
The formula to calculate the bill b per row is given by
b =0.01 n +0.02 s +0.06 x t
where n is the network usage in megabytes, s is the storage usage in blocks, x is the number of
servers used, and t is the number of hours the service is run. The bill is simply the sum of the
bills of each relevant row.
For example, for the input file
01/01/2000|Science|5|3.3|71|2/6
01/01/2000|Engineering|1|1.3|25|1/3
01/02/2000|Science|7|1.5|97|4/15
for customer Science, the total bill is 3.72

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

Professional Microsoft SQL Server 2014 Administration

Authors: Adam Jorgensen, Bradley Ball

1st Edition

111885926X, 9781118859261

Students also viewed these Databases questions