100% Guaranteed Results


BLG252E – Solved
$ 24.99
Category:

Description

5/5 – (1 vote)

İTÜ Computer Engineering Department
BLG252E Object Oriented Programming
3rd Homework Templates and Exception Handling
The main objective of this homework is to practice the following subjects:templates and exception handling. You are expected to code a game simulation. You will create a number of Money objects and store it inside an array. If the total amount of money in the array is bigger than 100 TL you will add to the sum of the array a 5 TL bonus. If it is less than 100 TL you will punish it with 5 TL. If it equals to 100 tl you will not change the sum of the array. You will apply the same scenario for integer and double arrays.
• In this homework you will implement a template class named as GenericArray which contains an array of elements of a selected type which can be built in types(int,double etc…) or user defined classes.
• As a user defined class, you will create a Money class to represent lira and kurus amounts.
• If money amount is less than 0 lira it should throw an exception (“Money cannot be less than zero”)
• GenericArray class will be template so its elements could be integer, double, or user defined class element such as Money class
• In your main function you should generate a number of money objects and you will store them in array also you will create a number of int or double variables which will be stored in another array then you will find sum of these arrays.
• You will design GenericArray class as a generic class template, so that it runs smoothly with the test programs provided.
• GenericArray class should have an attribute named total and if it is above than 100 TL you will increase the total amount as 5 TL

• You should design comparison operations in terms of operator overloading approach.
• 100 kurus= 1TL

Make sure that there is no memory leak in your code.
• Be careful with the methods/attributes that are supposed to be constant, static, private/public • You can add getters/setters when they are necessary.
• Use comments wherever necessary in your code.
• Your program should compile and run on Linux environment using g++ (version 4.8.5 or later). You can test your program on ITU’s Linux Server using SSH protocol. Include all necessary header files to your code. Do not use precompiled header files and Windows specific header files and functions.
• Submission Notes:
• You should also write a report to explain reasons why you need to use private/public/static/constant variables/methods in your program. Please make it possible to understand what you did in your program?
• After that, you should compress all files into an archive file named
“<your_student_number>.zip”. Do NOT include any executable or project files in the archive file. You should only submit necessary files.
• For any questions about the assignment, contact Muhammet şahin via e-mail muhammetsahin@itu.edu.tr

Reviews

There are no reviews yet.

Be the first to review “BLG252E – Solved”

Your email address will not be published. Required fields are marked *

Related products