CS508 Modern Programming Languages Assignment 2 Solution & Discussion Spring 2020
Assignment No. 02
CS508- Modern Programming Languages
Total Marks: 20
Due Date:12 June 2020
Please read the following instructions carefully before solving & submitting assignment:
It should be clear that your assignment will 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 completely or partially copied from (other student or ditto copied from handouts or internet).
· Student ID is not mentioned in the assignment File or name of file is other than student ID.
· The assignment is not submitted in .rar format.
If you do not submit any of the above mentioned file 50% marks per file will be deducted.
The objective of this assignment is to give students idea on how to implement object oriented concepts in ADA.
Lectures Covered: This assignment covers Lecture # 13 – 17
You will develop Ada console application in GNAT IDE. You can also use any online compiler to compile Ada.
As you know that we cannot implement inheritance in Ada directly as there is no concept of class in Ada, we need to use a mix of tagged types and packages.
You are required to create a tagged type as person and then another as men, the tagged type men will inherit from person type.
The person type has following attributes:
· Name: String
· Age: Integer
· Gender: Boolean
And also a function named print() [This function will print all three attributes of type person]
The tagged type men have following attributes
· Height: float
· ID: String
This type will also have one function named print() which must print all the attributes of type men and person as well.
When application starts an instance of type men will be created and detail of men will be taken from user input and assigned to men type object after that the added details will be printed on the console screen.