Git Product home page Git Product logo

problem_solving_with_java's Introduction

Problem Solving with Java

This repository contains some java problem solutions.

Tools & Technology used:

  • IntelliJ IDEA

Pre-Requisites

  • jdk

How to run this project:

  • Clone this project
  • Open this project with Intellij IDEA or other java programming software.

Java Problem Question

  1. Suppose, a=10 and b=20. Now swap the value without a temp variable. Output: a=20, b=10

  2. Here is the 10 students CGPA [3.50, 3.52, 3.43, 3.63, 3.48, 3.32, 3.30, 3.60, 3.86, 3.75] Find out who achieved the 2nd highest score. (without sorting, use linear searching algorithm)

  3. Sort the above scores from according to the order of highest CGPA (don’t use Arrays.sort() method, do it programmatically)

  4. From the given array find if your input CGPA is present using binary search algorithm

  5. Calculate and Print the MEDIAN of the CGPA

  6. Generate random 10 integer numbers in an array and print out all the numbers from the array and also print the max and min number from the array.

  7. Write a program that will break down the amount and count notes for any given amount. Here is the notes in the given array:
    notes=[1000,500,200,100,50,20,10,5,2,1] Input: 546 Output: 500 1 20 2 5 1 1 1

  8. Write a program that will give following output:
    1
    12
    123
    1234
    12345

  9. Write a program that will shuffle (values will randomly change their position) from the given array
    numbers=[1,2,3,4,5,6,7,8,9,0]

  10. Take input as height of 10 babies in cm. Now find out the 2 lowest height of babies. (Don’t use Arrays.sort() method)

  11. Count number of words, number of characters without spaces, number of vowels and consonant from the given string: Input: I am a SQA Engineer Output: Words: 5 Chars: 15 Vowel: 8 Consonant: 7

  12. Print the duplicate numbers in the given array. numbers=[1, 2, 3,1, 2, 4, 5, 6, 4] Output: 1 2 4

  13. Here is the array of lucky draw numbers: [100,150,140,180,170,200,250,230,220,300] Now, input any number from this array. The program will randomly generate any one number of this array. If your input number and generated number matches, it will print you are lucky! Continue it max 3 times until you are lucky. If at the 1st or 2nd time you are lucky, then the program will quit instead of giving you a chance 3 times.

  14. Write a program that will take integer numbers as user input continuously and print the sum of numbers until user input q from the keyboard. When user input q, the program will be quit. If the user inputs another character, then the program will ask to input the number again.

  15. A core i 7 laptop price is 85000 tk and a gaming mouse price is 2500 tk. If I buy the laptop and 1 piece mouse, what will be my total cost after giving 15% discount? [Extract the digits from the paragraph and calculate the price]

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.