CS411 Assignment 2 Solution and Discussion
Visual Programming (CS411)
Assignment # 2 (GRADED)
Total marks = 20 Due Date = 17th June 2020
Please carefully read the following instructions before attempting the assignment.
- First of all listen to the video lectures. Lecture No.8 to Lecture No.15 are included in assignment
- After that consult handouts and recommended books to clarify your concepts.
- You are supposed to submit your complete solution project as a single file (i. e. zip or RAR). Any other formats like scan images, PDF, bmp, docx etc. will not be accepted.
- It should be clear that your assignment would not get any credit if:
• The assignment is submitted after due date.
• The submitted assignment does not open or file is corrupt.
• The assignment is copied. Note that strict action would be taken if the submitted assignment is copied from any other student. Both students will be punished equally.
Assignment comprises of 20 Marks. Note that no assignment will be accepted after due date via email in any case (whether it is the case of load shedding or emergency electric failure or internet malfunctioning etc.). Hence, refrain from uploading assignment in the last hour of the deadline and try to upload Solutions at least 02 days before the deadline to avoid any inconvenience.
For any query please contact: [email protected]
You are required to create a C# Console application using Visual Studio with the following functional requirements:
Consider that you are going to generate the electricity bill of your own home. To generate this bill you need to consider following requirements.
• You will take previous meter reading as input and this previous meter reading will be any three consecutive digits of your VUID from which at least two digits should be nonzero. For example, Your VUID is BC123056789 so you can take 123,056 or 789 as your input.
• You will use current meter reading as 1000(fixed). No need to take it as input from user.
• While you input your digits on screen a windows form will appear which will perform the functionality of Event occurrence that will generate “Total Bill”. You can set location of button on screen according to your choice.
• First you will generate “Unit consumed for current bill”. For this calculation you will subtract the previous meter reading from the current meter reading to find the consumed units and display the consumed units on window form. It will be displayed as follows
• On second step you will perform the “Total bill” calculation considering the following conditions according to your generated units of current month and then display the Generated bill on windows form.
o If the consumed units are less than or equal to 300 then charge cost is 10 rupees per unit.
o If the consumed units are greater than 300 and less than equal to 500 then you will charge 10 rupees for 300 units and 15 rupees for units above 300. For example, if consumed units are 400 then calculation for first 300 units cost per unit will be 10 and remaining 100 units cost will be 15 per unit.
o If the consumed unit is greater than 500 then you will charge 10 rupees for 300 units, 15 rupees for 200 units and 20 rupees for those units which are above 500. For example, if consumed unit is 700 then calculation for first 300 units cost per unit will be 10 per unit, for 200 units cost will be 15 per unit and other 200 units which are above 500 cost 20 rupees per unit.
o In this way you have to find cost of total consumed unit considering above three conditions.
Note: You will use built-in delegate to pass the method (method name should be your VUID) and all the bill generation calculation will be performed under this method body.
Following Files Must be submitted in a single zip or rar file.
• .C# code file (file name should be your VUID)
• A .gif file which shows only “execution” of your Application (For Recording .gif a software named Screentogif is uploaded on LMS, or you can use any other gif recording tool as well)
You are not required to submit the complete project, only copy required file from project folder.
If you do not submit any of the above-mentioned file you will be awarded Marks partially.
Please share idea