C语言代写 C语言代做 C程序代写 C程序作业代写

C语言程序代写, C语言代写, C语言代做, C语言编程代写

C语言程序代写, C语言代写, C语言代做, C语言编程代写

COMP1711 Semester 1 2021/22 

Coursework 1 description 

This work awards a maximum of 30 marks and is worth 20% of the final module grade. 

Deadline 

To be submitted before 10:00am on 10th November 2021. 

Late penalties are 5% per day for every day, or part day, past the deadline. 

Skills tested 

This coursework will test your ability to write C code that correctly uses variables, expressions, 

assignment, and conditional logic. 

Description 

You will write a program for a water company. The program can calculate and print water bills 

for different customers. It can also compute and print a report of the company's financial 

revenue, profit, and other useful statistics. 

Details 

The water bill is split into fixed fee, consumption, processing and standing charge. 

Customers have to pay a fixed fee of £10 per quarter (3 months) for processing surface water 

(e.g. rain water) that drains to the public sewer from their property. 

To encourage customers to save water without penalizing low consumers, a water company has 

introduced an incremental pricing system. In this system, the price (tariff) of one cubic meter of 

water increases with increased consumption. To compute water charges, the overall 

consumption of a customer every 3 months (quarterly) is divided into bands, with consumption 

at higher bands charged a higher unit price than consumption at lower bands, as shown in the 

following table: 

Band 

Water consumption (m3

Unit price (£/m3

1-5 

0.20 

6-12 

0.35 

13-25 

0.50 

26-40 

0.75 

Above 40 

2.50 

In addition to the cost of fresh water, a customer is also charged for processing waste water that 

returns to the sewerage system. The company estimates the amount of water that returns to the 

sewer at 95% of the total fresh water consumption. The charge for waste water is £0.25/m3

Finally, each customer is charged a fixed daily (standing) charge of £0.10 per day. 

For simplicity assume that a quarter is always 91 days.In addition to domestic customers, the company also serves commercial customers. These 

customers pay the maximum tariff (of band 5) on all their consumption. Commercial customers 

also pay waste water processing charges at £2/m, a surface water processing charge of £50 

per quarter, and a standing charge of £1.30 per day. 

Commercial customers have to pay value added tax (VAT) at a rate of 20% on the total amount 

of the bill (domestic customers are exempt from VAT). 

The program specification 

You are provided with a skeleton code as a starting point: water.c 

This is available for download on Minerva. 

It implements a simple menu system that you should not alter. You can compile and run the 

code to display this. 

Add code to the C program so that it can be used to: 

1) Compute and print the bill for any customer. 

2) Compute the following quarterly sums and values: 

A. The total amount of fresh water consumed by all customers. 

B. The total amount of fresh water consumed by domestic customers. 

C. The total amount of revenue from all bills (this should not include collected VAT since 

this must be forwarded to the government). 

D. The total cost of providing water to customers. Assume that one cubic meter of water 

costs the company an average value of £1. This value covers all costs including fresh 

and wastewater processing, pumping, maintenance, wages, advertising, …etc. 

E. The profit (or loss!) of the company. Remember that profit = revenue – cost. 

F. The income tax the company has to pay to the government assuming an income tax 

rate of 25%. 

G. The average value of a domestic bill. 

H. The maximum value of a domestic bill. 

Guidelines 

 

The code will be tested on Gradescope. 

 

The file must be named water.c. 

 

Write the code in standard C. It must compile with gcc on school linux machines, 

i.e. gcc water.c –o water. 

 

If you add further scanf()/printf() statements for debugging please remove them before 

submission. 

 

Only add code in the indicated sections, this is to ensure the autograder runs. 

 

Please add your name and student details at the top of the file as comments.Marking 

The program computes domestic bills correctly (12 marks) 

The program computes commercial bills correctly (2 marks) 

The program computes the following values correctly: 

1. Total amount of fresh water consumed by all customers. (2 mark) 

2. Total amount of fresh water consumed by domestic customers. (2 mark) 

3. Total amount of revenue from all bills. (2 mark) 

4. Total cost of providing water to customers. (2 mark) 

5. The quarterly profit of the company. (2 mark) 

6. The amount of income tax the company has to pay. (2 mark) 

7. The average of all domestic bills. (2 marks) 

8. The maximum amount of a domestic bill. (2 marks) 

30 marks total. 

A partial Gradescope marker will be released nearer the deadline that you can use to check that 

you correctly compute domestic bills. 

This final grading will consider all aspects as above. 

A separate file of test data will be made available for you to use to check your coding.

京ICP备2025144562号-1
微信
程序代写,编程代写
使用微信扫一扫关注
在线客服
欢迎在线资讯
联系时间: 全天