Draw a flowchart (cellphone) so that it uses the following methods to calculate the billing amount. (In this programming, do not output the number of minutes during which the service is used.)
a. regularBill: This method calculates and returns the billing amount for regular
service.
b. premiumBill: This method calculates and returns the billing amount for premium
service.
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