GithubHelp home page GithubHelp logo

ritvik_fopjava_labalgo2's Introduction

Ritvik_FOPJava_LabAlgo2

Problem Marks (8) PayMoney. processes thousands of transactions daily amounting to crores of Rupees. They also have a daily target that they must achieve. Given a list of transactions done by PayMoney and a daily target, your task is to determine at which transaction PayMoney achieves the same. If the target is not achievable, then display the target is not achieved. TestCase 1

enter the size of transaction array 3 enter the values of array 20 12 31 enter the total no of targets that needs to be achieved 2 enter the value of target 21 Target achieved after 2 transactions

enter the value of target 19 Target achieved after 1 transactions

Explanation Target 1 i.e 21 is achieved after 2 transactions, (20 + 12)

Target 2 i.e 19 is achieved in the 1st transaction itself.


Test Case 2

enter the size of transaction array 1 enter the values of array 100 enter the total no of targets that needs to be achieved 1

enter the value of target 101 Given target is not achieved

Explanation → Since there is only 1 transaction that is of 100 and the target value is 101, hence target is not achieved.

  Question Marks (12 )

You are a traveler and traveling to a country where the currency denominations are unknown and as you travel you get to know about the denomination in random order. You want to make a payment of amount x, in such a way that the higher denomination is used to make exact payment.

Input

Take input of all the currency denominations ( random order) Take input of the amount that you want to pay.

Output

Print the minimum no of notes that you will be using to pay the net amount.

TestCase 1

enter the size of currency denominations 3 enter the currency denominations value 5 1 10 enter the amount you want to pay 12

Your payment approach in order to give min no of notes will be 10:1 1:2

TestCase 2

enter the size of currency denominations 5 enter the currency denominations value 60 5 12 78 25 enter the amount you want to pay 128 Your payment approach in order to give min no of notes will be 78:1 25:2

TestCase 3

enter the size of currency denominations 4 enter the currency denominations value 12 5 123 18 enter the amount you want to pay 158 Your payment approach in order to give min no of notes will be 123:1 18:1 12:1 5:1

Learning Objectives:

  1. Practice and enhance Logical skills.
  2. Implement the DSA concepts learnt in problem solving.
  3. Write efficient, clean and readable code.

ritvik_fopjava_labalgo2's People

Contributors

ritvikzz45 avatar

Watchers

 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.