Task Details given

1 answer below »
Task Details given



Task Details – Overview You are to develop a program that could be used by a company which offers deals to potential customers to use this company as their retailer for Gas– in other words, the bills gas will come from this company, if the customer agrees to sign up through them. Specifically, you are to provide the potential customers with “quotes” that indicate the cost that they would have paid if they had already been getting their gas or power from this company, based on the amount of gas/power they had used in the past. The company offers a few different types of agreements, which have different ways of calculating the fees/charges for the gas or electricity consumed. The following sections explain what the program needs to do (Functional Requirements), and then this is followed by some additional matters which must be addressed by the code. Following parts of the program: 0. FR-2: Create a new Gas Plan 0. FR-3: See a detailed description of a Gas Plan 0. FR-4: Allow the user to create a quote for a potential customer using a particular Gas Plan 0. FR-5: Generate a report of a quote for a potential Gas customer to a text file 0. FR-6: Preserve the Gas Plan types between executions of the program Coding Requirements Gas Plans The program must provide for two different types of gas supply & usage plans. One gas supply & usage plan (Gas Plan - Type 1) is to calculate the cost for a billing period in the following manner: 1. Using Steps of usage. For example, the first ‘step’ may be a quantity of 800 Megajoules, charged at a particular rate per Megajoule (MJ). The second ‘step’ may be a quantity of 500 Megajoules charged at a different particular rate. The remaining quantity of gas used is then charged at another particular rate. 1. For example, if the first step charges $0.021901 for each of up to 800 Megajoules, and the second step charges $0.020145 for each Megajoule used of up to 500 further Megajoules, and the third step charges $0.019784 for each subsequent Megajoule used, then for a customer who used 1450 Megajoules in the period, the calculation would be as follows: (800 x 0.021901) + (500 x 0.020145) + (150 x 0.019784) 1. For another customer who only used 1170 Megajoules, the calculation would be this: (800 x 0.021901) + (370 x 0.020145) + (0 x 0.019784) The period in which the accumulation of usage applies, is usually a 2-month period. That is, after 60 days, the ‘usage’ resets to 0, and the initial step is being used again. In addition, there is a daily “service availability” charge – charged at some rate (e.g. $0.76) for each day that the billing period covers (so a 60 day billing period would be 60 x 0.76 charged for making the gas available to that address). The other type of gas supply & usage plan (Gas Plan - Type 2) is to charge customers one rate during the “winter” months of April to September, and a different rate in the “summer” months October to March. For example, maybe for a particular plan of this type, the winter rate is $0.01857 per MJ used, and in summer the rate is $0.02137 per MJ used. Again, there is a daily “service availability” charge. The billing period for this type of gas plan is 3 months (aligned to the start of the calendar year). Input Data Files Gas Usage files These files contain data spread across several lines which have specific meanings: 1. The first line is the name of a potential customer 1. The second line is the address of that potential customer 1. The third line is the amount of gas (in MJ) they consumed during the most recent January to March period. 1. The fourth line is the amount of gas (in MJ) consumed during the most recent April to June period. 1. The fifth line is the amount of gas consumed during the most recent July to October period. 1. The sixth line is the amount of gas consumed during the most recent September to December period. Functional Requirements The following are the Functional Requirements (FR) that the program must achieve. FR-1: The program must be a text-console menu-based system The program needs to allow the user flexibility in what actions they perform, and so you should be designing the user interaction to make use of menus, that is, you display to the user a list of the actions that they can perform as a numbered list, and the user selects the desired action by entering the corresponding number. The program must allow the user to do the following: 1. Create a new Gas Plan 1. See details about a particular Gas Plan 1. Create a quote for a potential customer using a particular Gas Plan 1. Quit (saving all Plans to a file) FR-2: Create a new Gas Plan The program must allow the user to create various types of “plans” for Gas customers to possibly sign-up for. Plans are made in one of two flavours, or types, as described earlier (type 1, and type 2). The user must be asked to specify whether the new plan they are creating will be a type 1 or type 2 plan. Depending on which type of plan is selected, the user will need to be asked to enter the various rates to be used for the plan. For example, for the type 1 plan (the one including green energy) you would need to ask for the dollar-rate per MJ for each of the three ‘steps’; or for the type 2 plan you would need to ask for the dollar-rate per MJ for the winter and the summer period. You would also need to ask what the daily service availability charge should be. Use the information to create a suitable object that represents the Gas Plan. Each Gas Plan should have a name (which is used for marketing of that plan to customers) e.g. “Summer Saver” might be a type 2 gas plan which sets the rate for summer time periods much cheaper than the rate for winter time periods. Store the object representing the plan’s details in a central place in memory so that later it may be selected for use in creating a quote for a customer. FR-3: See a detailed description of a Gas Plan After a plan has been created in memory, or restored into memory from file (see later FR), it must be possible for the user to select the plan from a list of all Gas plans and then have its details displayed. This will allow the user to confirm the plan is set-up correctly before (or after) customers are signed-up to the plan. For example, for a type 2 gas plan, the following might be the output shown: Plan Name: Winter Economiser Gas Charge rate for summer months: $0.02167 per MJ Charge rate for winter months: $0.01953 per MJ Daily charge for Gas Availability: $0.58 Billing Period: 3 months (91/92 day intervals) Different information would be reported for a type 1 gas plans. FR-4: Allow the user to create a quote for a potential customer using a particular Gas Plan Once there are some plans in memory, they can be used to estimate the costs for a potential customer who chooses that plan, based on the customer’s prior usage patterns. The user should be asked to specify the name of a file containing the details of the customer’s past gas usage data. This information needs to be read into memory, and then provided to suitable method(s) of one of the objects representing a Gas Plan. The particular Gas Plan object to use should be selected by the user from a list of all the previously created plans that were stored in memory (see FR-X). The data obtained from the file may need to be processed before or after being provided to the Gas Plan methods. For example, since you are given data about usage for a whole year as four 3- month time-periods, for a type 1 plan you will need to add these to find the total used in a year, and divide into 6 to get a 2-month usage estimate. For the type 2 plan you can just use the four time periods to work out each period’s cost. The outcome of this FR is the creation of a suitable object representing a Quote (like a bill, but not expecting payment). The Quote needs to know the name and address of the customer; and when the Quote is displayed or output to file it should show things as though it was a bill – so reporting the elements comprising the total costs (one per line), and then stating the total cost. Exactly what elements to report, will have to depend on the kind of gas plan (type 1 or type 2) that the selected plan was created as. The quote should show for one billing period (either 2 or 3 months, depending on the plan type) how the total cost is calculated based on the data from the file and selected plan type. The methods of the Gas Plan object mentioned earlier should simply generate the information to go into the object representing the Quote (so that those methods won’t need to be called again and again for the same Quote); the only thing that needs to be done with a Quote once it is made (before returning to the main menu), is displaying it on screen and also writing the information into a text file, as explained in the next FR - There is no need to retrieve the quote at a later time (no need to store it for later). In making your solution for this FR, aim to use polymorphism. FR-5: Generate a report of a quote for a potential Gas customer to a text file At the conclusion of the preparation of a quote as detailed in the previous FR, you should display the quote on the screen for the user, but should also ask them if they want to save the quote to a file. If the user says that they do want to save it, you will need to ask for the name of a file. Then you should create a text file which contains the same output as was displayed on the screen. An example of the output for a type 1 Gas plan quote is shown here: Quote Customer: Fred Flintstone Address: 42 Rocky Road Selected Plan: Home Starter Gas Plan Based on the usage information provided, this is what you bill would look like for an average 2-month period (usage of 1403 MJ): Step 1 (up to 750 MJ): 750MJ @ 0.02416 $18.12 Step 2 (next 440 MJ): 440MJ @ 0.02211) $ 9.72 Step 3 (remainder): 213MJ @ 0.02183 $ 4.65 Supply Availability charge: 60 days @ 0.71$42.60 Total Cost$75.09 Exact cents do not need to be rounded; but
Answered 4 days AfterMay 29, 2022

Answer To: Task Details given

Sathishkumar answered on Jun 01 2022
90 Votes
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here