@zaasmi said in CS411 Assignment 1 Solution and Discussion:
Visual Programming (CS411)
Assignment # 01
Total marks = 20
9th December, 2021
Please carefully read the following instructions before attempting assignment.
RULES FOR MARKING
It should be clear that your assignment would not get any credit if:
• The assignment is submitted after the due date.
• The submitted assignment does not open or file is corrupt.
• Strict action will be taken if submitted solution is copied from any other student or from the internet.
• Lectures 1 to 6 are covered in this assignment(Marks 20)
No assignment will be accepted after the due date via email in any case (whether it is the case of load shedding or internet malfunctioning etc.). Hence refrain from uploading assignment in the last hour of deadline. It is recommended to upload solution file at least two days before its closing date.
If you people find any mistake or confusion in assignment (Question statement), please consult with your instructor before the deadline. After the deadline no queries will be entertained in this regard.
For any query, feel free to email at: [email protected]
You are required to create a C# Console application using Visual Studio.
Your code should be able to calculate price for sacrificial animals that can be goat, sheep and camel separately while using the concept of POLYMORPHISM.
• Your code should work in such a way that you need to create 3 classes, one parent class i.e. Animal and other three derived classes that will be goat, sheep and camel.
• The function that needs to be override would be of Price Calculation.
• So, your code should work in such a way that at first you should enter the last NUMERIC character of your vu id as a number of animals you want to buy. (Note: You should also check if the last numeric character of your vu id is zero then your code should increment it with 1 so in any case your code should atleast buy one animal). After that, you should be asked for the first five numeric characters of your VUID which will be later used as a rent. Rent will be included in the price of animal that we will hard code.
• Now you need to make a menu/options as shown in the screenshot below, which will ask you if you want to calculate price for the sheep then press 1, if you want to calculate price for goat press 2, if you want to calculate price for camel then press 3, OR if you want to quit simply press 0 (Note: Your Loop should break when user presses 0)
• Your loop should run exactly the same number of times as you have entered for the number of animals you want to buy i.e. last numeric character of your vu id.
• You can use hard-coded values for the price of sheep, goat and camel like 50,000, 80,000, 100,000 respectively.
• Formula to calculate price is: Total Price = rent+price (according to the animal selected)
• Your output should be exactly same as shown in the screenshot below.
DO REMEMBER that you must use your VUID as an input in this program.
Following Files Must be submitted in a single zip or rar file.
• .cs code file (file name should be your VUID)
• Screenshot of your output.
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.