Homework 12. Object usage practice Ján Dugáček February 3, 2019 Ján Dugáček 12. Object usage practice Homework Table of Contents 1 Homework Ján Dugáček 12. Object usage practice Homework Exercises 1 Create a random number generator class that keeps its own state; you can use simple multiplication and modulo to generate random numbers 2 Create a VotingBox class that has a vote() method accepting two arguments, name of the voter and name of the voted person, prevents the same voter from voting more than once and has a result method to report the most popular option of voters Ján Dugáček 12. Object usage practice Homework Advanced Exercises 1 Create a labyrinth class that either generates or reads a labyrinth, adds a path through it if there is none and allows accessing nodes that contain a list of pointers to other nodes accessible to it 2 Create a class that parses markdown, holds the parsed data and allows saving it as markdown, TeX or HTML; you have to support only markup for words in bold and italic Ján Dugáček 12. Object usage practice Homework Exercises #2 1 Write an object that gives access to a easy::vector created from file name supplied in its constructor and updates the file with the changes when the object is deleted 2 Write a rational number class that is saved as a fraction and supports addition, subtraction, multiplication, division and comparison with both integers and other rational numbers 3 Create a importanceQueue class that has a method to add a string with some importance (two arguments) and a method to remove and return the most important string Ján Dugáček 12. Object usage practice Homework Homework Create a mathvector class that contains a fixed number of elements that can be accessed with the [] operator and supports +=, -=, *= and /= operations You have two weeks to do it Challenge for the Advanced: create also a mathmatrix class that supports common matrix operations that work with scalars and mathvector as in algebra Ján Dugáček 12. Object usage practice