Java | JSP | JSF Answers

Questions answered by Experts: 3 611

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Search

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.




  1. Give an implementation of the size() method for the DoublyLinkedList class, assuming that we did not maintain size as an instance variable.
Class named RectanglePerimeter with the following methods: +perimeterCalculator(double length,double breadth) : double - Should take two numbers and return a number as result - The logic for finding perimeter should be implemented in this method Use Main method class and display the output using object of RectanglePerimeter
Class named BankCustomer Create the following properties.  -customerid : int  -name : String  -baseamount : double -accounttype : String Use parameterized constructor for initializing values Methods . withdrawAmount(int amount) - reduce amount from baseamount . addAmount(int amount)  add amount with baseamount
While using a computer, a user uses the ALT TAB key to sch between applications. The ALT-TAB window works on the principle of holding the ALT key for MRU listing.Hence the applications arrange themselves in such a way that the most Recently used application will be the first item in the ALT TAB window and so forth. You are given the list of opened applications and the number of the that the user presses the Tab key switch between applicate the final arrangement of application in the ALT-TAB window Example In the given picture, Libraries application in focused which means that holding the ALT key,the user presses the Tab key twice internet.Explore being the most recently used application followed by libraries and so on. Output specification input1: An array representing the percentage of numbers in each city Input2: Number of cities in the country Output Specification: Return the favorable city index'i'. Example 1: input1: {1,1,3,6,7,3} input2: 6 Output: 4 Please give the java coding solution for this question

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]


LATEST TUTORIALS
APPROVED BY CLIENTS