GithubHelp home page GithubHelp logo

stage0-module3-taskfinal's Introduction

FINAL MODULE TASK

1) Print false.

You will be given 2 variables and your task will be to print false using those vars:

    public class PrintingFalse {
        public static void main(String[] args) {
            int first = 9;
            int second = -17;
            //write code here
        }
    }

2) Division by zero.

In the given code snippet you should pick correct primitive type to allow division by zero. Which means that the program must be able to perform division without any exception, etc. In order to do this you will have to search for additional info yourself.

    public class DivisionByZero {
        public static void main(String[] args) {
            _ number = 10;
            System.out.println(number/0);
        }
    }

Instead of "_" sign set correct var type.

3) Positive numbers detector.

Implement program that will print if number is positive true, otherwise false (no if or ternary). Code snippet:

public class NumbersPrinter {
    public void printIsPositive(int number) {

    }
}

Where number - variable that should be used within the program.

4) Numbers reverter.

Revert 3-digit number that will be passed (e.g.: given -> 489, expected -> 984) and print it. Code snippet:

    public class NumberReverter {
        public void revert(int number) {
        }
    }

Where number - variable that should be used within the program.

5) Digits sum calculator.

You will be given a four-digit number your task will be to find the sum of all digits in the given number. Code snippet:

    public class DigitsSumCalculator {
        public void calculateSum(int number) {
        }
    }

Where number - variable that should be used within the program.

6) Temperature converter.

You will be given temperature in celsius and your task will be to print this temperature in fahrenheit (formula will be required). Code snippet:

    public class TemperatureConverter {
        public void toFahrenheit(int temperatureCelsius){
        }
    }

Where temperatureCelsius - variable that should be used within the program.

stage0-module3-taskfinal's People

Contributors

andrekukshinov avatar art-orient avatar cow4bunga 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.