Giter VIP home page Giter VIP logo

assignment2's Introduction

Assignment2

Please solve the following problems.

Guideline for creating branch

create your branch in follwing format: yourprojectname/yourname/date

Task 1

Write the Java code of a program that prints the first ten positive whole numbers. [Do NOT use loops]

Task 2

Write the Java code of a program that prints the first ten even positive whole numbers. (Do NOT use loop or modulus operator for this problem).

Task 3

Write the Java code of a program that reads one number from the user, and prints it back to show which number was entered by the user.

Task 4

Write the Java code of a program that reads two numbers from the user, and prints their sum, product and difference.

Task 5

Write the Java code of a program that reads the radius of a circle and prints its circumference and area.

Task 6

Write the Java code of a program that reads two numbers from the user and prints “first” if the first number is greater than the second number.

Task 7

Write the Java code of a program that reads two numbers from the user. Your program should then print “first is greater” if the first number is greater, and “first is not greater” otherwise.

Task 8

Write the Java code of a program that reads two numbers from the user. Your program should then print “first is greater” if the first number is greater, “second is greater” if the second number is greater, and “the numbers are equal” otherwise.

Task 9

Write the Java code of a program that reads two numbers, subtracts the smaller number from the larger one, and prints the result.

Task 10

Write the Java code of a program that reads a number, and prints “The number is even” or “The number is odd”, depending on whether the number is even or odd. (Hint: use the modulus operator)

assignment2's People

Contributors

resilientbd avatar raihan878 avatar

Stargazers

Md Feroze Alam Sarder avatar

Watchers

James Cloos avatar  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.