Given two stacks with their standard operations (pop, push, isEmpty, size), implement a queue with its standard operations (enqueue, dequeue, isEmpty, size).
There should be two versions of the solution.
Version A: The queue should be efficient when enqueuing an item; and Version B: The queue should be efficient when dequeuing an item.
1. Suppose you have been working with an organization called 'Money Traders' for the past few years. The organization is into the money trading business. Your manager assigned you a task. For a given array of stock's prices for N days, find the stock's span for each day.
The span of the stock's price today is defined as the maximum number of consecutive days(starting from today and going backwards) for which the price of the stock was less than today's price.
For example, if the price of a stock over a period of 7 days are [100, 80, 60, 70, 60, 75, 85], then the stock spans will be [1, 1, 1, 2, 1, 4, 6].
Explanation:
On the sixth day when the price of the stock was 75, the span came out to be 4, because the last prices (including the current price of 75) were less than the current or the sixth day's price.
Similarly, we can deduce the remaining results.
You have to return an array of spans corresponding to each day's stock's price.
Using a while loop create a program that will prompt the user for a positive number and then print out a multiplication list of all the between the given number and one(inclusive), These are referred to as the factorial and it is only applicable for positive numbers, see link for more
Create an algorithm for this problem.(5 points)Create the pseudocode for this problem. (5 points) Create the flowchart for this problem (5 points)Code the solution for this problem
•You must have a method called happyVerse and this method must include the print out statements for 1 verse of your song(2 points)•Your happyVerse must take in 2 arguments (set up 2 parameters to accept the action and sound that will be passed in from the main method)(3points)•Your main method must call the happyVerse method 3 times:(3points)
oAction: “clap your hands”Sound:“clap” oAction: “stomp your feet” Sound: “stomp”oAction: “shout Hurray!’Sound: ‘hoo-ray”•Your program compiles and prints 3 verses of the “If You’re Happy and You Know It” song (2points)
The government has decided to charge 0.5% tax on every car purchased from KTA. You are to write a Java program. Your program should:
a. Request for a username and password to be inputted. Your username and password should grant access to the program if they are correctly inputted
b. Your program should have a method that calculates and displays the tax on any car purchased.
c. Your program should be able to perform “b” above at least 10 times.
d. Assuming sales have now gone up and the government has scraped the tax incentive. A tax of 25% imposed on each car sale. Modify a portion of the code to reflect the new development.
e. Explain how the Ghana Revenue Agency (GRA) can use your program to calculate tax on goods imported into the country.
Create a program that takes in a student first name and average mark obtained, the system should the group the students using the first letter in their name modulus 10 [ Remember that characters are considered as numeric values, hence ‘J’%10 is a valid calculation ]. For example if the student name is Cena, then the student belongs to group 7 because ‘C’%10 = 7 and if the name was Jack then the student belongs to group 4. The program should further use the group number to get the group lecturer and class date as follows: [Hint: If the result is 0 then the student belongs to group 10]