Giter Site home page Giter Site logo

daily-bite-course-02's Introduction

Modern-only C++ course - Homework

This repository contains the homework for Lesson 2.

Celsius

Implement two functions, one that converts from Celsius to Fahrenheit and one that converts from Fahrenheit to Celsius in celsius/celsius.cc.

The goal is to have the following commands pass without any errors:

bazel test //celsius/...
bazel test --config=addrsan //celsius/...
bazel test --config=ubsan //celsius/...

GCD and LCM

C++ already offers a standard version of the greatest common divisor algorithm. As an exercise, implement your own version in gcd/gcd.cc.

Once you have finished, also implement the least common multiple algorithm in gcd/lcm.cc. The build system is already setup to make your GCD implementation available to you when you are implementing least common multiple.

The goal is to have the following commands pass without any errors:

bazel test //gcd/...
bazel test --config=addrsan //gcd/...
bazel test --config=ubsan //gcd/...

Fibonacci

Implement a function that returns the n-th fibonacci number in fibonacci/fibonacci.cc.

For the purpose of this exercise, consider the zero-th and first fibonacci numbers: 0, 1.

The goal is to have the following commands pass without any errors:

bazel test //fibonacci/...
bazel test --config=addrsan //fibonacci/...
bazel test --config=ubsan //fibonacci/...

Solutions

If you desire to have a look at the solutions, you can find the commented code in the solutions directory.

daily-bite-course-02's People

Contributors

maboulmagd 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.