Giter VIP home page Giter VIP logo

basic_function_homework's Introduction

Basic Function Homework

Automated grading of homework assignments and tests

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

Problems

Arithmetic01

Create a function called add. Create a function argument x of type int. Create a parameter int type y of type int. return sum of two parameters.

Example 1:

Input: 4, 5
Output: 9

Arithmetic02

Create a function called divide. Create function arguments a and b of type int. Returns the floor division of a and b.

Example 1:

Input: 4, 2
Output: 0

Arithmetic03

Create a function called func. Create function arguments a and b of type int. Returns the remainder of a and b.

Example 1:

Input: 5, 3
Output: 2

Arithmetic04

Create a function called multiple. Create function arguments a and b of type int. Return the multiplication of a and b.

Example 1:

Input: 5, 3
Output: 15

Arithmetic05

Create a function called func. Create a fucntion argument ‘number’ two digits numbers will be given. return the sum of the number’s digits.

Example 1:

Input: 45
Output: 9

Arithmetic06

Create a function called func. Create a function argument called ‘number’ of type int the two-digit numbers will be given. Find the reverse of the number and return to a variable called ‘answer’ return answer

Example 1:

Input: 65
Output: 56

Arithmetic07

Create a function called func. Create a function argument called ‘number’ of type int the three-digit number will be given. Find the ‘number’ first digit and assign to x1. Find the ‘number’ second digit and assign to x2. Find the ‘number’ third digit and assign to x3. Create a variable called ‘answer’ and assign it the sum of the three digits. return the sum of the digits.

Example 1:

Input: 456
Output: 15

Example 2:

Input: a = 0
Output: 0

Arithmetic08

Create a function called func. Create a function argument called ‘number’ type of int. Create a variable called ‘answer’. Find the remainder of the division of number by 3 and assign it to ‘answer’. return the answer.

Example 1:

Input: 7
Output: 1

Example 2:

Input: a = 8
Output: 9

Arithmetic09

Create a function called func. Create a function argument called ‘number’ of type int. Find the remainder of the division of number by 2 and assign it to ‘answer’. return the answer.

Example 1:

Input: 7
Output: 1

Example 2:

Input: a = 8
Output: 7

Arithmetic10

Create a function called func.

Example 1:

Input: a = 5
Output: -5

Example 2:

Input: a = 1
Output: -1

Warning

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

basic_function_homework's People

Contributors

xmaxkambek avatar olimjonsn avatar sanjarbek17 avatar naxalov 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.