Design and develop functions and classes to manage levels

Assignment Help Software Engineering
Reference no: EM133172769

ADS103 Algorithms and Data Structures

Assessment - Programming Assignment

Learning Outcome 1: Identify and utilise data structures appropriately to solve software engineering problems.

Learning Outcome 2: Apply fundamental object-oriented programming concepts to demonstrate understanding.

Learning Outcome 3: Design and develop functions and classes to manage levels of code complexity.

Learning Outcome 4: Demonstrate the ability to read and interpret moderately complex code, describe its purpose, and systematically debug for issues in syntax or logic.

Assessment Task

Implement the inheritance and linked list tasks below to demonstrate your understanding of object- oriented programming and memory allocation.

Please refer to the Task Instructions for details on how to complete this task.

Context
This assessment focuses on the use of classes and inheritance to solve software design problems, requiring you to grow and demonstrate your understanding of object-oriented programming (OOP) fundamentals. Inheritance is a powerful way to modularise your code, further allowing for easy testing and reuse.

Further, you will apply your knowledge of the concepts and management of data and memory to the building of a linked list, a key data structure used as a base for many containers in use today.

These are fundamental skills required by the software engineering industry.

Instructions

To complete this assessment task, you must build solutions to the two problem tasks. Ensure that:
• Code is well documented with comments
• Class, function, and variable names follow the naming conventions set by the learning facilitator
• Code is indented and broken down into smaller functions and files where it will improve clarity and improve testing
• Any third-party code should be appropriately attributed to the creator or original source

Task 1: Classes and Inheritance

This first program will simulate a battle between Role Playing Game (RPG) characters. You'll need to make classes to represent the different kinds of characters, and those classes will inherit common features from a base class, reducing redundance.

Step 1

Build a base class called Character and two subclasses called Warrior and Mage inheriting from Character class.
Further extend the inheritance tree by building a class called Paladin, inheriting from
Warrior class.

Step 2

Below is a list of attributes(variables) you're going to need for the characters. You'll need to decide which classes they should be in, at which levels of the inheritance tree above. Keep in mind that common attributes to all classes should be inherited where possible. These attributes are private, so the appropriate getter and setter methods should be implemented.

Attributes: name, hitPoints, manaPoints, strength, defence, ragePoints, fireballDamage, healAmount

Step 3

The following methods should be callable on objects of all your classes:

DoAction(): Returns an int of how much damage the action does. Output what action is taking place to the user
TakeDamage(int dmg): Subract defence from the damage and subtract the result from hitPoints. You should always do at least 1 point of damage. Output remaining hitPoints at the end of the method
IsAlive(): Returns true if hitPoints are greater than zero

Warrior should override the DoAction method to follow this logic:
If ragePoints greater than 15
spend 15 ragePoints to do HeavySwing and return the damage from that attack
else
Add 5 ragePoints to total Return strength (default attack damage)

Warrior's heavySwing method should do more damage than their strength alone, multiplying it by some value (2x, 3x, etc.-you may decide based on balancing)

Mage should also override the DoAction method to follow this logic:

Paladin should also override the DoAction method and decide to Heal using ragePoints if
hitPoints are low. Note: healing Paladin should return zero damage from the DoAction method.

Step 4
Each class should have a constructor method to set their attributes to default values. Add any other additional methods you need.

Step 5

In the main function of the program, instantiate Paladin and Mage objects and, using a while loop, get them to battle until one of them is no longer alive. Make them hit each other like so:

Int paladinDamage = paladin.DoAction();

mage.TakeDamage(paladinDamage);

Task 2: Linked List

Write your own custom LinkedList class and a program to create and run a variety of performance tests on LinkedList objects.

Define class Node that holds a data of type int and has a pointer to next Node.
Define class LinkedList to help organise Nodes into a singly LinkedList data structure.
Write a program that instantiates two LinkedList objects, linkedList1 and linkedList2.
Using a time library (include chrono or other), measure how long it takes to insert 50,000 random numbers into linkedList1 at the beginning of its structure in milliseconds.
Measure how long it takes to insert 50,000 numbers onto the back of linkedList2 in milliseconds.
Compare, in code, the time taken inserting into each list (steps 2.4, 2.5) and output a message to the console stating which approach was more efficient.
Delete all Nodes starting from the front of linkedList1.
Delete all Nodes in linkedList2 starting from the back.
Compare, in code, the time taken deleting the contents of each list (steps 2.7, 2.8) and output a message to the console stating which approach was more efficient.

Referencing
It is essential that you use appropriate APA style for citing and referencing research.

Attachment:- Algorithms and Data Structures.rar

Reference no: EM133172769

Questions Cloud

Impact of rapid environmental changes on organizations : What does an organizational environment include? What is the impact of rapid environmental changes on organizations?
What amount should Park report as cost of goods sold : During the current year, Park Corp. recorded $368,000 of sales of inventory to Small Co., What amount should Park report as cost of goods sold
How should Quebec account for the scrip dividend : The notes, which were dated April 1, 2012, had a maturity date of March 31, 2013, and a 10% interest rate. How should Quebec account for the scrip dividend
Who should handle the allegation : Whistle-Blower Allegations are a serious matter and should not be handled by management for fear of reprisal. Who should handle the allegation
Design and develop functions and classes to manage levels : Demonstrate the ability to read and interpret moderately complex code, describe its purpose, and systematically debug for issues in syntax or logic
Prepare a cash budget for September and October : The budget must plan for enough cash on December 31 to pay the spring semester tuition, Prepare a cash budget for September, October, November, and December
Nurse leader and manager decisions : Nurse leaders and managers and are responsible for making decisions in healthcare setting. illustrates their interpretation of DECIDE. Expand someone else ideas
At what rate must rental cost increase each year : Renting the equivalent space costs $20,200 per year. If the annual interest rate is 5.8%?, at what rate must rental cost increase each year
Create the series of spreadsheets using the excel workbook : Create the series of spreadsheets using the excel workbook provided in your student pack.

Reviews

Write a Review

Software Engineering Questions & Answers

  Research report on software design

Write a Research Report on software design and answer diffrent type of questions related to design. Report contain diffrent basic questions related to software design.

  A case study in c to java conversion and extensibility

A Case Study in C to Java Conversion and Extensibility

  Create a structural model

Structural modeling is a different view of the same system that you analyzed from a functional perspective. This model shows how data is organized within the system.

  Write an report on a significant software security

Write an report on a significant software security

  Development of a small software system

Analysis, design and development of a small software system.

  Systems analysis and design requirements

Systems Analysis and Design requirements

  Create a complete limited entry decision table

Create a complete limited entry decision table

  Explain flow boundaries map

Explain flow boundaries map the dfd into a software architecture using transform mapping.

  Frame diagrams

Prepare a frame diagram for the software systems.

  Identified systems and elements of the sap system

Identify computing devices, which could be used to support Your Improved Process

  Design a wireframe prototype

Design a wireframe prototype to meet the needs of the personas and requirements.

  Explain the characteristics of visual studio 2005

Explain the characteristics of Visual Studio 2005.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd