Coder Social home page Coder Social logo

cpp2-praktikum's People

Contributors

jotoho avatar dependabot[bot] avatar timbeckmann avatar johpin002 avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

cpp2-praktikum's Issues

Tasksheet 3

Tasks
The following things are required of us:

  • Create folder 3/
  • Create class Liste
  • Implement the following prototypes as methods of the class:
    • Liste()
    • ~Liste()
    • void add(int wert)
    • void clear()
    • bool contains(int wert)

Tasksheet 2

This week's task revolves around taking the previous work under /1/ and expanding on it with more features.

Tasks

The following things are required of us:

  • Copy contents of 1/ into folder 2/ (Done. See c33d225)
  • Rework the Stack class to use dynamically allocated memory, instead of a statically sized array on the stack.
  • Implement the following prototypes as methods of the class:
    • Stack();
    • Stack(const Stack&);
    • ~Stack();
    • const Stack& operator=(const Stack&);
  • Modify the Stack::push(int) method such that pushes to a full Stack allocates a larger block of memory, copies over the existing contents, frees the old block and adds the parameter to the new block of memory.

Open questions

  • The tasks explicitly mention that the type of the storage block should be changed from int[] to int*. Should we take this to mean, that we cannot use a reliable storage structure, like a std::vector internally and avoid all memory management headaches?
    Yes, the type needs to be int*
  • The description of changes required to Stack::push(int) explicitly mentions copying the memory over. Does this mean we need to do so manually ourselves or can we use C stdlib functionality like realloc()?
    We can use realloc

Assignment 4 - Mandatory assignment for entry to final exam

In order to get admitted into the final exam of this course, we need to complete the following tasks.

  • Expand Liste class with the following methods. When ever a method fails, it should throw exceptions.
    • void add_last(int wert)
    • void add_first(int wert)
    • int remove_last()
    • int remove_first()
    • int get(std::size_t index)
  • Create tests for all (wtf?) failure scenarios
  • Overload operator[] for the Liste class
  • Implement a Stack using class Liste in the form of delegation

Floating point exception + fehlerhafte Addition

  • Bei der Addition (Klasse Fraction) muss der Bruch vorher erweitert werden, um auf den gleichen Nenner zu kommen. Ihre Implementierung berechnet zur Zeit 1/3 + 1/3 = 1/3, was eigentlich 2/3 ergeben müsste.
  • Es kann keine Null (0/1) abgebildet werden. 1/3 - 1/3 erzeugt eine "Floating point exception (core dumped)" genau wie der Versuch, 0/1 als Fraction zu instanzieren.

Pin workflow versions

Currently the CI job for locking threads and the github actions base used in the format checker refer to very broad version ranges. To avoid unplanned behaviour changes, I will be pinning those to specific version numbers.

If updates are pushed to those automations, I want to read the changelogs first and bump the dependency version number manually or with the help of dependabot.

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.