Code Monkey home page Code Monkey logo

r_java_lab1's Introduction

Лабораторна робота №1

Тема: Основні типи та оператори мови програмування Java.
Мета: Ознайомлення з основними типами та операторами в Java. Здобуття навичок у використанні типів та операторів в Java.

З умовою можна ознайомитися за посиланням

Номер залікової книжки: 1209

  • С2 - остача від ділення номера заліковки на 2:
    = 1209 % 2 = 1 => O1 = "-"

  • С3 - остача від ділення номера заліковки на 3:
    = 1209 % 3 = 0 => C = 0

  • С5 - остача від ділення номера заліковки на 5:
    = 1209 % 5 = 4 => O2 = "-"

  • С7 - остача від ділення номера заліковки на 7:
    = 1209 % 7 = 5 => Тип i та j - "float"

=> Загальна формула:
formula.png

Спрощений варіант:
formula_final.png


BigDecimal у коді

В якийсь момент у мене почали падати тести, хоча за реалізацією все наче було правильно. Подивившись логи, побачила наступне:
whyBigDecimal1
whyBigDecimal2
Чому так відбувається можна почитати тут.
Я ж вирішила цю проблему привівши тип float до типу BigDecimal.

r_java_lab1's People

Contributors

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