Reference no: EM133567831
Software Development Fundamentals
The purpose of this assignment is to assess students on the following Learning Outcomes:
Learning Outcome 1: Explain the basic programming concepts such as computer storage and data types, decision structures, loops, and modular programming.
Learning Outcome 2: Use problem solving techniques and program design methods to translate a problem description to a formal program specification.
Learning Outcome 3: Differentiate various object-oriented programming constructs, including classes, inheritance, polymorphism, and encapsulation.
Details & Problems
In this first assignment, you are required to answer two short questions, give output of the code, and develop two C# Console Programs to demonstrate your ability to use C# input/output via command line, C# primitive and built-in C# types, C# operators and expression, C# conditional statements, C# loop construct, and show your ability to validate the inputs to avoid run-time errors.
Assignment Description
Object Oriented Programming (OOP) is a programming model where programs are organized around objects and data rather than action and logic. OOP allows decomposition of a problem into several entities called objects and then builds data and functions around these objects.
A class is the core of any modern Object-Oriented Programming language such as C#. In OOP languages it is mandatory to create a class for representing data.
A class is a blueprint of an object that contains variables for storing data and functions to
perform operations on the data. A class will not occupy any memory space and hence it is only a logical representation of data.
You must have learnt it already in the lecture so far that to create a class, you simply use the keyword "class" followed by the class name. Also, some description about the Objects is provided below, which again you must have covered in the lectures.
Objects are the basic run-time entities of an object-oriented system. They may represent a person, a place, or any item that the program must handle. "An object is a software bundle of related variable and methods." "An object is an instance of a class".
All the programming languages supporting Object Oriented Programming will be supporting these three main concepts,
1. Encapsulation
2. Inheritance
3. Polymorphism
Abstraction provides you a generalized view of your classes or objects by providing relevant information.
By considering all this information provided above about the classes, objects, inheritance, polymorphism, and abstraction, answer the following questions:
Question 1: write C# code for calculating area of
1. Circle
2. Triangle
3. Rectangle
4. Square
5. Pyramid
6. Cone
7. Rhombus
Question 2: Suppose you have an object 'Shape' and three types of shapes as provided below:
Circle (Features: Radius, Area, Circumference)
Rectangle (Features: Length, Width, Area, Perimeter)
Triangle (Features: Base, Height, Area, Perimeter)
Abstract information (necessary and common information) for the object "Shape" is that all shapes have an area and perimeter.
Write the code to create an abstract class for a Shape object in C#.
Write the formal program specification describing the names of the class, subclasses, and their attributes to be used for the above assignment description. Briefly describe the inheritance relationships between them.