0% found this document useful (0 votes)
9 views

Fall 2024_CS201P_2

302 paper

Uploaded by

usmankhan363644
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views

Fall 2024_CS201P_2

302 paper

Uploaded by

usmankhan363644
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Assignment No.

2 Total Marks: 20
Semester: Fall 2024 Due Date: 31st Dec, 2024
CS201P – Introduction to Programming(Practical)
Instructions
Please read the following instructions carefully before submitting the assignment:
It should be clear that your assignment will not get any credit if:

o Assignment is submitted after the due date.


o Submitted assignment does not open or file is corrupt.
o Assignment is copied (From the internet/students).
o Assignment is submitted in any file format other than .cpp.

Recommended tool to develop Assignment


- Dev C++

Objectives:
To enable students to understand and practice the concepts of:
 Functions
 Function calling
 Classes and objects

Assignment Submission Instructions


You must submit only a .cpp file on the assignments interface of CS201P from your LMS account. Assignments
submitted in any other format(image, pdf, doc, docx, etc) will be scaled with zero marks. So, check your
solution file format before submission.

For any query related to the assignment, please contact [email protected].

Assignment

Problem Statement:
Imagine a recruitment process for candidates applying to join the Air force. Suppose there are three candidates
named “Babar”, “Rizwan” and “Shan” whose eligibility is checked for recruitment on the basis of their key
attributes Height, weight and age.

Eligibility criteria for the selection is as below:


i. Candidates must be within the age range of 18 to 22 years (inclusive). If a candidate is younger than 18
or older than 22, they are not eligible for recruitment.

ii. Candidates need to have a body weight in the range of 52 – 60 kg. Any candidate who weighs less than
52 kg or more than 60 kg is deemed ineligible.

iii. The minimum height requirement for selection is 5.6 feet. Candidates who are shorter than 5.6 feet do
not meet the criteria for eligibility.
Write a class in C++ that reads the attributes for each of the candidate and check their eligibility for recruitment on
the basis of above criteria.
Display the result of their attributes, their eligibility status and reason if non-eligible.

Step by step procedure:

1. Your business logic should be included in a class named “Recruitment” in C++.


2. You should include a default constructor in your class and include a logic inside this constructor to display
your Name and VUID. Use of other student ID will be considered a cheating case and marks will be
deducted.
3. The attributes of the candidates must be declared inside the class as instance variables.
4. Include a parameterized constructor inside the class to assign the values to the attributes (instance variables
of class) of candidates. No setxxx() function is allowed in a class to assign the values to instance variables.
5. Include an instance member function to check and set the eligibility of a candidate on the basis of
eligibility criteria defined above.
6. Include an instance member function to display the whole status of a candidate along with eligibility
status and reason if non-eligible.
7. Don’t call a function inside the body of another function inside a class. Marks will be deducted if this
guideline is violated.
8. Include a utility function inside a class to display “how many times the parameterized constructor is
called”? You can use a static variable, counter to count the number of parameterized constructor calling.
9. Your main() function only include the logic of creating instances or objects of class and calling the
functions accordingly to deduce the outcome. The values of attributes and name for each candidate
inside the main() should be hard coded.

Note: Remember that if you have not used your name and student id in the program your marks will be deducted.

Sample screenshot on CMD:


Sample 1:
Sample 2:

Syllabus:

The syllabus for this assignment includes all topics covered from Lab 3 to Lab 10.

Best of luck!

You might also like