Coder Social home page Coder Social logo

bcs370's Introduction

BCS 370 Data Structures

Module 1:

Module 2:

Module 3:

Given the Student struct definition as follows: struct Student { std::string name; int age; }; 2. Create a class Class that has int classSize and Student* students as its private member variables.

  1. Create a parameterized constructor that takes an int argument to be passed in and assigned to the member variable classSize. The constructor creates a dynamic array of Student objects with classSize elements.The function uses pointer arithmetic to assign default values (such as name="", age=0) to each object.
  2. Also, construct the destructor, ~Student(), for the class.
  1. In main(), simply instantiate an object to ensure the program works.

//note: *(students+i) will return the Student object at index i //on students array.

Module 8:

โ€“ Stack You will be creating a stroke-based sketch book app, using stack data structure. The app menu items include the following actions (methods): draw(); erase(); undo(); redo(); A drawing is made of strokes. When draw() is called, a new stroke is made; when erase() gets called, the latest stroke is deleted from the screen; when undo() is called, the latest stroke is removed, but the record is saved; when redo() is called, the last undo() action (stroke) is recalled back. For example:

  1. draw (stroke 1)
  2. draw (stroke 2)
  3. undo(): remove stroke 2 and saved to an undo list
  4. draw (stroke 3)
  5. redo(): put stroke 2 back to the drawing list
  6. redo(): redo list is empty, nothing to be put back
  7. draw (stroke 4)
  8. erase(): stroke 4 is permanently removed from drawing list and is not saved in the undo list The final drawing list should be: stroke1->stroke3->stroke2 Can you design and implement the program, including the above methods, using stack data structure? You may directly use C++ library or for this assignment.

bcs370's People

Contributors

shamikae avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.