Question

In: Computer Science

Misty is fond of pokemons and likes to collect pokemon cards. She has P pokemon cards...

Misty is fond of pokemons and likes to collect pokemon cards. She has P pokemon cards with her at present. She wants to have a particular number of cards on the Dth day. Her friend Ash is ready to help her to achieve the number. Ash will provide her N cards daily so that a day before the Dth day, she will have the required number of Pokemon cards.

Solutions

Expert Solution

Solution:

I have solved this question in java since no programming language is specified .

Also I am afraid the question is incomplete. I kind of know this since I have already solved the same question

If you need any changes please comment

Herw is the complete question:

Question:

Misty is fond of pokemons and likes to collect pokemon cards. She has P pokemon cards with her at present. She wants to have a particular number of cards on the Dth day. Her friend Ash is ready to help her to achieve the number. Ash will provide her N cards daily so that a day before the Dth day, she will have the required number of Pokemon cards.

Example:

Misty has cards with her, P = 5

D = 6

Ash will provide her with cards daily, N = 4

Ash provides pokemon cards:

Day 1 = 4

Day 2 = 4

Day 3 = 4

Day 4 = 4

Day 5 = 4

Total cards Ash provides = 4 + 4 + 4 + 4 + 4 = 20

Total number of pokemon cards Misty has on the Dth day = 5 + 20 = 25

Misty is busy with her tournament and wants to know the total number of pokemon cards she will have on Dth day. Can you tell her?



Input Format

The first line of input consists of the number of test cases, T

The only line of each test case consists of three space-separated integers, P, N and D.



Constraints

1<= T <=100

1<= D <=100000

0 <= P, N <=100000

Program:

import java.util.Scanner;

class Pokemon {
        public static void main(String args[])
        {
                Scanner sc=new Scanner(System.in);
                //Test cases
                int T=sc.nextInt();
                while(T-->0)
                {
                        int P,N,D;
                        //Gettting inputs for P,N,D
                        P=sc.nextInt();
                        N=sc.nextInt();
                        D=sc.nextInt();
                        //Using D-1 since a day before
                        int ans=N*(D-1)+P;
                        System.out.println(ans);
                }
        }

}

Screenshot of code and output:


Related Solutions

Misty is fond of pokemons and likes to collect pokemon cards. She has P pokemon cards...
Misty is fond of pokemons and likes to collect pokemon cards. She has P pokemon cards with her at present. She wants to have a particular number of cards on the Dth day. Her friend Ash is ready to help her to achieve the number. Ash will provide her N cards daily so that a day before the Dth day, she will have the required number of Pokemon cards.
Please code in python or C++ Misty is fond of pokemons and likes to collect pokemon...
Please code in python or C++ Misty is fond of pokemons and likes to collect pokemon cards. She has P pokemon cards with her at present. She wants to have a particular number of cards on the Dth day. Her friend Ash is ready to help her to achieve the number. Ash will provide her N cards daily so that a day before the Dth day, she will have the required number of Pokemon cards. Example: Misty has cards with...
Your goal is to collect all 80 player cards in a game. The Player cards are...
Your goal is to collect all 80 player cards in a game. The Player cards are numbered 1 through 80. High numbered cards are rarer/more valuable than lower numbered cards. Albert has a lot of money to spend and loves the game. So every day he buys a pack for $100. Inside each pack, there is a random card. The probability of getting the n-th card is c(1.05)-n, For some constant c. Albert buys his first pack on June 1st....
OK Corporation sells gift cards in various denominations. The company likes to sell these cards because...
OK Corporation sells gift cards in various denominations. The company likes to sell these cards because cash is collected immediately, but a certain percentage will never be redeemed for merchandise. On December 1, Year One, OK reported a balance in unearned revenue of $728,000 from the sale of gift cards. a. During December, OK sold an additional $578,000 in gift cards. Prepare this journal entry. b. During December, gift cards totaling $327,000 were redeemed to purchase inventory that had originally...
Lily likes to play games with integers. She has created a new game where she determines...
Lily likes to play games with integers. She has created a new game where she determines the difference between a number and its reverse. For instance, given the number 12, its reverse is 21. Their difference is 9. The number 120 reversed is 21, and their difference is 99. She decides to apply her game to decision making. She will look at a numbered range of days and will only go to a movie on a beautiful day. Given a...
Jasmine has decided that while she likes flowers, she does not like getting her hands dirty....
Jasmine has decided that while she likes flowers, she does not like getting her hands dirty. She decides to sell her interest in FG to Rose for $150,000. Assume that at the time of sale, her properly calculated tax basis in FG is $135,000. Here are some additional facts: FG has total debt outstanding of $105,000. FG is a cash basis business. FG has receivables from sales to customers of $60,000. FG has other tangible assets with a FMV of...
Janice really likes potatoes. Potatoes cost $0.50 per pound, and she has $5.00 that she could...
Janice really likes potatoes. Potatoes cost $0.50 per pound, and she has $5.00 that she could possibly spend on potatoes or other items. Suppose she feels that the first pound of potatoes is worth $1.50, the second pound is worth $1.14, the third pound is worth $1.05, and all subsequent pounds are worth $0.30. a)How many pounds of potatoes will she purchase? b) What if she only had $3.00 to spend?
Janice really likes potatoes. Potatoes cost $1.25 per pound, and she has $5.00 that she could...
Janice really likes potatoes. Potatoes cost $1.25 per pound, and she has $5.00 that she could possibly spend on potatoes or other items. Suppose she feels that the first pound of potatoes is worth $1.50, the second pound is worth $1.14, the third pound is worth $1.05, and all subsequent pounds are worth $0.30. a. How many pounds of potatoes will she purchase? b. What if she only had $2.00 to spend?
Case study Alana is entering the end-of-life stage. She often has difficulty breathing. She likes Mai...
Case study Alana is entering the end-of-life stage. She often has difficulty breathing. She likes Mai to stroke her arm and apply massage oil. One morning she whispers to Mai that she doesn’t have the energy to see her friends and extended family anymore. She asks if Mai can tell them that she loves them, but she can’t see them anymore. As Mai is helping her out of bed, Alana says, ‘I don’t think I can have a shower today’....
Alice wants to sell her Pokemon card collection on eBay. She decides to accept the first...
Alice wants to sell her Pokemon card collection on eBay. She decides to accept the first bid that exceeds 100$. Suppose that each bid that she receives is chosen uniformly at random between 0$ and 110$ (the bids are continuous, i.e., real numbers in that interval). Let X be the number of bids Alice receives (once she accepts a bid, the auction is over and she does not receive any more bids). (a)Is X discrete, continuous, or neither? (b)Find the...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT