Graded Assignment

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

Assignment

Instructions:
 Create just one cpp program with switch case for individual problem statement. Have
self-explanatory print(cout) statement for user input/output.
 File name should be in the format: <SID>_<First_name>.cpp
 Copying assignments will result in ZERO marks in assignment for the party involved.
And would also attract necessary disciplinary action/higher penalties. Therefore, it is
advised to get less marks instead copying and then facing harsher action.
 Submission would be through Moodle. Link to the same will be shared along with
username and password.
 Deadline for submission would be 11:59 PM, 17th November, 2019 and would not be
extended. Late submission will be allowed with suitable penalties.

1. Calculate BMI(Body Mass Index) of a person and display Underweight /Normal


/Overweight /Obese as per Table given in Appendix-I. Take name, height(in inches)
and weight( in pounds) from user.

2. The graph of a person’s emotional cycle y = f(x) is a sine curve having an amplitude
of 1 and a period of 28 days. On a given day, the person’s emotional index is f(age),
where age is his or her age in days. Similarly, the physical and intellectual cycles are
sine curves having an amplitude of 1 and periods of 23 and 33 days, respectively.
Write a function that receives a person’s age and returns his or her physical,
intellectual, and emotional indices for the current day. Write another function to
compute a person’s biorhythm index, which is the sum of the physical, intellectual,
and emotional cycles.

3. Create a class to store student’s data such as name, SID and branch. Define separate
member functions in this class to get and set values of the data members such as
getSID(), setSID(int) for SID and so on. Define constructors to assign default values
to the data members. Ask the user for number of students in a class and create that
many number of objects dynamically (using new operator). Ask user to provide
student details for individual student, if denied, keep the default values. Count the
number of objects created in the program using a static data member “count_obj” and
print this using static member function (call this function without class object). Free
the dynamically allocated memory when it’s usage is completed.

4. Create a class “date_class” that contains data members corresponding to month name,
day number, and year. Define appropriate constructors, destructor, get/set methods for
input and output. Implement operations: (a) difference between two dates (overload
binary - operator using member function); (b) increment date by 1 day (overload
unary ++ operator using friend function); (c) find number of days in the given month.
Appendix-I

You might also like