Giter Site home page Giter Site logo

camp_weekday_task3's Introduction

README

This README would normally document whatever steps are necessary to get the application up and running.

Things you may want to cover:

  • Ruby version

  • System dependencies

  • Configuration

  • Database creation

  • Database initialization

  • How to run the test suite

  • Services (job queues, cache servers, search engines, etc.)

  • Deployment instructions

  • ...

camp_weekday_task3's People

Contributors

n-ryo avatar intern2019spring avatar

Watchers

James Cloos avatar

camp_weekday_task3's Issues

平日課題4:VCAppの拡張

課題詳細

calcs_controllerのshowアクションについて

  1. 演算子がdivisionのとき、余りも出力してください。
  2. 0で割ったときの例外ZeroDivisionError < StandardErrorをrescueを用いて補足し、計算結果と同様に出力してください。
  3. 一連の値操作と計算ロジックをActiveRecord::Concernのmoduleへ共通メソッドとして切り出してください。module名はCommon。メソッド名はcalculationとしてください。

受け入れ基準

  • 商と余りが出力される。例:0..1(1/2のときの出力)
  • 0で割ったときにdivided by 0と表示される
  • これまで通りの出力結果を得られる。

完成イメージ

課題1

課題2

課題3

省略

平日課題3:計算アプリ CALC

課題詳細

  • コントローラとビューを作成して計算アプリを作成して下さい。

  • URLに指定した値を使用して四則演算を行います。

演算子 説明
addition 足し算
subtraction 引き算
multiplication 掛け算
division 割り算
  • URLに calcs/値1/演算子/値2 を指定した場合、「値1」、「演算子」、「値2」をパラメータで受け取り、計算します。
    • 例1) /calcs/1/addition/2 を指定したらビューに 1 + 2 の結果である 3 を表示します。
    • 例2) /calcs/3/subtraction/1 を指定したらビューに 3 - 1 の結果である 2 を表示します。
  • URLは /calcs/ までは固定で、それ以降をパラメータで受け取る必要があります。
  • params[XXX]で受け取った値は文字列として認識されるので、 to_i メソッドを使用して数値に変換してから計算する必要があります。
  • コントローラ名は calcs 、アクション名は show で作成して下さい。

課題リンク

平日課題3:計算アプリ CALC

完成イメージ

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.