GithubHelp home page GithubHelp logo

stage0-module4-conditions-taskfinal's Introduction

FINAL MODULE TASK

1. Season determiner.

Implement the program that will print the season name to the console by the number of the month. If month is incorrect -> print "Wrong month number". Month will be passed as the method argument. (Example: "1" -> "Winter", 0 -> "Wrong month number")

 public class SeasonDeterminer {
    public void tellTheSeason(int monthNumber) {
    }
 }

2. Triangle sides validator.

Create a program that will consume 3 points as method arguments and will print to the console if those points can build up a valid triangle or not. (output when correct: "this is a valid triangle", otherwise : "it's not a triangle")

 public class TriangleValidator {
     public void validate(double firstSide, double secondSide, double thirdSide) {
     }
 }

3. Days in a month.

Create a program that will consume a year and a month (validation is required) and will print amount of days in this month considering also if a year is leap or not.(prints amount of days or else "invalid date", negative years are not accepted)

public class DaysInMonth {
    public void printDays(int year, int month) {

    }
}

4. Integer divider.

Create a program that will consume 2 integers from method args (dividend and divider) and will perform integer division of dividend be divider, save the value, and then will multiply result by divider and will if got value is equal to dividend will print:"can be divided completely", otherwise "cannot be divided completely" or "division by zero".

   public class IntegerDivider {
       public void printCompletelyDivided(int dividend, int divider) {
   
       }
   }

5. Coordinate Pane.

Create a program that will consume 2 integers from method args as data of a coordinate point in a XY coordinate system and determine in which quadrant the coordinate point lies(beginning with top right:"first", "second", "third", "fourth", "zero"):

   public class CoordinatePane {
       public void printQuadrant(int x, int y) {
   
       }
   }

6. Bitwise values swap.

Implement the program that will swap 2 variables without creating new variables or objects, using bitwise operators:

 public class BitwiseValuesSwap {
     public void swap(int first, int second) {
     }
 }

stage0-module4-conditions-taskfinal's People

Contributors

andrekukshinov avatar kyryloepam avatar mikalai-karamach avatar sukora-stas 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.