Answered step by step
Verified Expert Solution
Question
1 Approved Answer
need answer asap :/ Question 2 (20 MARKS) The Nusa UniCity is a convenience college university that has three building of hostel (block A, B
need answer asap :/
Question 2 (20 MARKS) The Nusa UniCity is a convenience college university that has three building of hostel (block A, B and C) located in Nusajaya. At the end of each year, the management wants to know the total bill of these hostels from January to December. They have decided to use a computer program to help them in analyzing the hostel's bill. You, as a freelance programmer have been appointed to develop the program using C language. The requirements of the program are as follow: Input: : The program should read in bill data from a text file. The format of the input file is as follows: Three columns are for block A, B and C bills. While twelve rows data is for January to December bill. Figure 1 below shows an example of input file named "bill2016.txt" containing bill data for the year 2016. 2840 3030 2530 2760 3220 3140 3080 3110 2960 2890 2940 2700 4500 4740 4620 4560 4720 4800 4600 4530 4420 4260 4360 4200 3760 3630 3720 3850 3940 4070 3860 3800 3770 3680 3600 3550 Figure 1: An example of input file, "bill2016.txt" 8 of 6 Output: : The program should print out a report into a text file named report2016.txt. The report should include: o The total bill for January to December. o The total, max and min bill for each hostel. o The grand total of bill, over all hostel bills throughout the year. Figure 2 shows an example report file for the sales data of the year 2015. Arrays: The program should use array(s) to store the bill data. Write a complete C program based on the requirements given above. 3 MONTH 1 2 3 4 5 6 7 8 9 10 11 12 TOTAL ELECTRIC BILL YEAR 2016 HOSTEL BLOCK A B 2840 4500 3760 3030 4740 3630 2530 4620 3720 2760 4560 3850 3220 4720 3940 3140 4800 4070 3080 4600 3860 3110 4530 3800 2960 4420 3770 2890 4260 3680 2940 4360 3600 2700 4200 3550 TOTAL 11100 11400 10870 11170 11880 12010 11540 11440 11150 10830 10900 10450 TOTAL MAX MIN 35200 3220 2530 54310 4800 4200 45230 4070 3550 134740 12090 10280 Figure 2: The output file for the bill data in Figure 1Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started