• Cyberian's Gold

    Re: CS411 Assignment 1 Solution and Discussion

    Visual Programming (CS411)
    Assignment # 1 (GRADED)
    Total marks = 20 Due Date = 1st June 2020
    Please carefully read the following instructions before attempting the assignment.

    1. First of all listen to the video lectures.
    2. After that consult handouts and recommended books to clarify your concepts.
    3. 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.
    4. 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.

    Important Note:
    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]
    Problem Statement:
    You are required to create a C# application Console using Visual Studio with the following functional requirements:
    Create 4 classes:

    1. Bowler 2.Spinner 3.Medium 4.Fast

    Each class will have a function named “speed” which will output speed as specified by class name.

    61de52b5-256a-4c18-bdc1-b9b80335cdbe-image.png
    You will program this as follows

    • You will take as an input the last two digit of your VUID. For example your ID is BC123456789 so you take here “89” as input and program will decide which range it belongs to i.e. Fast, Medium, Spinner
    • For this you create bowler type object and later on initialize it with spinner, medium and fast bowler as per below provided ranges.
     Spinner pace bowler has range of 00 to 33
     Medium pace bowler has range of 34 to 66
     Fast pace bowler has range of 67 to 100
    • If bowler pace is not in the specified range then the object type must be bowler.
    Further, if any user tries to enter alphabetical value, it should through Exception and let the user to enter a new numeric value.

    Note: Program must show your own VUID usage.

    Submission details
    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.

  • Cyberian's Gold

    @zaasmi said in CS411 Assignment 1 Solution and Discussion:

    e65f2192-00ef-48b9-badf-5e82a47c3b60-image.png
    Visual Programming (CS411)
    Assignment # 01
    Total marks = 20

    Deadline Date:
    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:

    • Lectures 1 to 6 are covered in this assignment
    NOTE
    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]

     (Marks 20)
    

    Problem Statement:
    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.
    Required Output:
    6ce1968f-49ce-497e-92b2-a050740f19c3-image.png

    Note:
    DO REMEMBER that you must use your VUID as an input in this program.

    Submission details
    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.

    “The End”

  • Cyberian's Gold

    e65f2192-00ef-48b9-badf-5e82a47c3b60-image.png
    Visual Programming (CS411)
    Assignment # 01
    Total marks = 20

    Deadline Date:
    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:

    • Lectures 1 to 6 are covered in this assignment
    NOTE
    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]

     (Marks 20)
    

    Problem Statement:
    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.
    Required Output:
    6ce1968f-49ce-497e-92b2-a050740f19c3-image.png

    Note:
    DO REMEMBER that you must use your VUID as an input in this program.

    Submission details
    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.

    “The End”

  • Cyberian's Gold

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    
    namespace bc160
    {
    
        class Bowler
        {
            public virtual void speed()
            {
                Console.WriteLine("Only enter last two digit your id");
    
            }
        }
    
        class Spinner : Bowler
        {
            public override void speed()
            {
                Console.WriteLine("spinner pace bolwer");
    
            }
        }
    
        class Mediam : Bowler
        {
            public override void speed()
            {
                Console.WriteLine("Mediam pace bolwer");
    
            }
        }
    
        class Fast : Bowler
        {
            public override void speed()
            {
                Console.WriteLine("Fast pace bolwer");
    
            }
        }
    
    
        class Program
        {
            static void Main(string[] args)
            {
    
                Bowler b1 = new Bowler();
    
            enter:
                Console.WriteLine("Enter last two digit your id");
                String num = Console.ReadLine();
                try
                {
                    int vuid = Int32.Parse(num);
                    if (vuid >= 00 && vuid <= 33)
                    {
                        b1 = new Spinner();
                        b1.speed();
                    }
                    else if (vuid > 33 && vuid <= 66)
                    {
                        b1 = new Mediam();
                        b1.speed();
                    }
                    else if (vuid > 66 && vuid <= 100)
                    {
                        b1 = new Fast();
                        b1.speed();
                    }
                    else
                    {
                        b1.speed();
                    }
                }
                catch (FormatException)
                {
                    Console.WriteLine("Enter an integer number only", num);
                    goto enter;
                }
                Console.ReadKey();
            }
        }
    }
    

    Complete Solution File Spring 2020_CS411_1_SOL

  • Cyberian's Gold

    This post is deleted!
Insaf Sehat Card Live Cricket Streaming
  • 2
  • 5
  • 1
  • 1
  • 9
  • 4
  • 4
  • 3
Quiz 100% Result Quiz 100% Result
| |