Codingassignmenthelper | Home Codingassignmenthelper | Samples

algorithms assignment

algorithms assignment

algorithms assignment

		COMP.6211
Algorithms
and Data
Structures

Assignment 1

Assignment one
Semester one, 2020
Due Date: Monday27thApril
Weighting: 30%
Marks: 100 marks

COMP.6211

Assignment 1

Semester 1, 2020

Learning outcomes:



Use and develop abstract data types.
Implement common data structures and algorithms.

Assignment Requirements:
Instructions:
The assignment must be a product of your own work, except for the use of resources supplied with the
course, discussions conducted with the lecturers, and other assistance shown as acceptable in the section
Assistance to Other Students below.

Assistance to other students:
Students themselves can be excellent resources to assist the learning of fellow students, but there are issues
that arise in assessments that relate to the type and amount of assistance given by students to other
students. It is important to recognise what types of assistance are beneficial to another’s learning and also
what types of assistance are acceptable in an assessment.
Beneficial Assistance (this assignment)
 Study Groups
 Discussion
 Sharing reading material
Unacceptable Assistance
 Working together on one copy of the assessment and submitting it as your own work
 Giving another student your work
 Copying someone else’s work
 Changing or correcting another student’s work
 Copying from books, the Internet etc. and submitting it as your own work

Toi-Ohomai Institute of Technology
Faculty of Business, Design and Service Industries

Page 2

COMP.6211

Assignment 1

Semester 1, 2020

Project Requirements
Part 1 (50%)
You are to develop a basic flocking simulation.
Utilise appropriate data types and algorithms to produce a solution to the problem.
Suggested algorithms are:
 Move - Relative to user input
 Move - Automatically
 Lock - To a domain
 Follow - Move to a target
 Runaway - Move from a target
 Collide - Basic collision of objects
 Randomize - Add a random element

Part 2 (50%)
You are to implement a simple system to generate a ‘Lucky Dip’ Lottery
Ticket.

The following Class diagram describes the relationship between the classes.

MainWindow

Lotto

Tasks
The Lotto class should provide the following functionality:
 Initialize an array of 6 integers.
 Set the array to zero.
 Generates 6 random numbers in a range 1 to 49 in the array.
 Sort the numbers in the array in ascending order (utilise a bubble sort or relevant sort algorithm of your
choice).
 Format and display the numbers (number output in the range 1 to 9 should be preceded by a blank
space) in the array.
The Program class should provide the following functionality:
 Instantiate a Lotto class object.
 Construct a Lottery Ticket that allows the customer to have as many (between 1 and 20) randomly
generated Lucky Dips as they require on the same ticket.
Toi-Ohomai Institute of Technology
Faculty of Business, Design and Service Industries

Page 3

COMP.6211



Assignment 1

Semester 1, 2020

Display the ticket and ‘Lucky Dip’ numbers to the screen in the correct format.

Toi-Ohomai Institute of Technology
Faculty of Business, Design and Service Industries

Page 4

COMP.6211

Assignment 1

Semester 1, 2020

Sample Output
The layout of your Lucky Dip Ticket should reflect the following sample output.
Five Lucky Dips selected

Fifteen Lucky Dips selected

Twenty Lucky Dips selected

Class Lotto
class Lotto
Field Detail
numArray
randomNumber
 Fields used to store lotto numbers.
Constructor Detail
Lotto
 Create a new Lotto by initializing the numbers array and random number field.
Method Detail
SetNumbersToZero
 Sets the six numbers to zero.
GenerateNumbers
 Randomly generates six unique numbers between 1 and 49.
SortNumbers
 Sorts the numbers in ascending order(utilise a bubble sort or relevant sort algorithm).
PrintNumbers
 Format and prints the numbers in the array (number output in the range 1 to 9 should be preceded by a
blank space).
Toi-Ohomai Institute of Technology
Faculty of Business, Design and Service Industries

Page 5

COMP.6211

Assignment 1

COMP.6211– Algorithms and Data Structures
AssignmentMarking schedule

Semester 1, 2020

Semester 1, 2020
Student Name:
Student ID:
Marks
available

Marks
Scored

Part 1 - Flocking Simulation
Basic movement triggered by user input is supported
Basic auto-generated movement is supported
Domain boundaries are used to define the limits of the simulation
Follow a designated target is supported
Runaway from a designated target is supported
Basic collision is supported
Random elements are incorporated into the solution

5

Optimisation and portability has been considered in the solution
Basic functionality has been extended with the purpose of adding additional features to
the simulation

5

5
5
5
5
5
5

10

Part 2 - Lottery Ticket - Lotto Class
Field definitions reflect the requirements defined in the class description

2

Constructor implemented to the specification defined in the class description

2

SetNumbersToZero method implemented to the specification defined in the class
description
GenerateNumbers method implemented to the specification defined in the class
description

2
12

SortNumbers method implemented to the specification defined in the class description

12

PrintNumbers method implemented to the specification defined in the class description

8

Part 2 - Lottery Ticket - MainWindow Class
Lotto class object instantiated in MainWindow class

2

Functionality allows the user as many randomly generated Lucky Dips as they require
(between 1 and 20) on the same ticket

2

Lottery Ticket reflects the sample output

8

Total

Toi-Ohomai Institute of Technology
Faculty of Business, Design and Service Industries

100

Page 6


		
To Download Click Here > algorithms assignment.pdf
Codingassignmenthelper | Home Codingassignmenthelper | Home