Giter Site home page Giter Site logo

control_flow_statements_homework's Introduction

Welcome

Control flow statements

Automated grading of homework assignments and tests

  • fork this repository
  • solve the task
  • commit with proper message
  • commit with proper message

Problems

if01

Given three integers a, b, c, check the following statement "The number b is between a and c".

Example 1:

Input: a=1
Output: 2

Example 2:

Input: a=-5
Output: -5

Constraints:

  • -1018<=num<=1018

if02

If the number is positive, increase it to 1, else decrease it to 2.

Example 1:

Input: a=5
Output: 6

Example 2:

Input: a=-1
Output: -3

Constraints:

  • -1018<=num<=1018

if03

If the number is positive, increase it to 1, else decrease it to 2. If it is 0, assign 10.

Example 1:

Input: a=-9
Output: -11

Example 2:

Input: a=3
Output: 4

Constraints:

  • -1018<=num<=1018

if04

Find how many positive numbers there are in the given numbers.

Example 1:

Input: a=-2 b=4 c=1
Output: 2

Example 2:

Input: a=3 b=-3 c=-6
Output: 1

Constraints:

  • -1018<=num<=1018

if05

Find how many negative numbers there are in the given numbers.

Example 1:

Input: a=-2 b=4 c=1
Output: 1

Example 2:

Input: a=3 b=-3 c=-6
Output: 2

Constraints:

  • -1018<=num<=1018

if06

Find how many positive and how many negative numbers there are in the given numbers.

Example 1:

Input: a=-2 b=4 c=1
Output: "there are a lot of positive numbers"

Example 2:

Input: a=3 b=-3 c=-6
Output: "there are a lot of negative numbers"

Constraints:

  • -1018<=num<=1018

if07

Given an integer a, check the following conditions: "positive odd number", "positive even number", "negative odd number", "negative even number", "the number is zero"

Example 1:

Input: a=57
Output: "positive odd number"

Example 2:

Input: a=-24
Output: "negative even number"

Constraints:

  • -109<=num<=109

if08

Given an integer a, check the following conditions: "two-digit odd number", "two-digit even number", "three-digit odd number", "three-digit even number"

Example 1:

Input: a=57
Output: "two-digit odd number"

Example 2:

Input: a=-242
Output: "three-digit even number"

Constraints:

  • -103 < num < 10 3

if09

The two-digit integer is given.
Replace the digits of the number.
True if the resulting number is less than or equal to the old number, otherwise return False.

Example 1:

Input: a=57
Output: False

Example 2:

Input: a=21
Output: True

Constraints:

  • -103 < num < 10 3

if10

Display the message according to the following temperature conditions given to you in Celsius:
Temp<0: "Freezing"
Temp 1-10: "Very Cold"
Temp 11-20: "Cold"
Temp 21-30: "Normal"
Temp 31-40: "Hot"
Temp >40: "Very Hot"

Example 1:

Input: a=21
Output: "Normal"

Example 2:

Input: a=-4
Output: "Freezing

Constraints:

  • -103 < num < 10 3

Warning

  • don't copy other solutions or any solution
  • don't remove comments

control_flow_statements_homework's People

Contributors

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