Questions: 11 448

Answers by our Experts: 10 707

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 & Filtering

you want tobuy a particular stock at its loerest price andsell it later at its highest price,since the stock market is unpredictable,yousteal the price plans of a company for this stockfor the next N days.

Find the best price you can get to buy this stock to achieve maximum profit.

Note:The initial price of the stock is 0.

Input1:Nnumber of days.

Input2:Array representing changein stock price for the day.

Output: Your function must return the best price to buy the stock at.

Example:

Input1:5

Input2:{-39957,-17136,35466,21820,-26711}

Output:-57093


John is going through his family photo album.There is a total of N people in the family labeled 0 to N-1.

Find out the number of members of his family who have more than or equal to X children.

Input specification:

Input1:N,denoting the total number of family members.

Input2:X,denoting the minimum number of children a family members should have in order to be included in john’s final set.

Input3:An array of N elements where the ith element denotes the parent of the ith index. If the value of the element is -1,then that family member has no parent.

Example:

Input1:1

Input2:0

Input3:{-1}

Output=1 


coin collection

Rob is fond of collecting coins but unfortunately,sometimes he has to sell a coin to get other coins.he puts all his coins one over the other in a column.

There can be 2 types of Operations:

(0,i):Add coin with value i to the collection.

(1,0):sell a coin.

Selling a coin:

For selling a coin ,he picks up the top coiin in the coloumn if he constraint A is satisfied.Constraint A:Rob can only sell the coin if the coin collection value is more than Y.

Upon emoval ,the coin collection value goes to the previous value.Initially,with 0 coins ,coin collection value is 0.

Adding a Coin:

on addong a coin of value i to the collection the coin collection value increments via the following prodcedure.

If the coin collection had>=X value then current total value is X+i else X+2*i.

Rob needs to find and return the final value of coin collection after Q operations.

Note : Initially,the value X is 0 and not X.

Example1:

input1:10

input2:0

input3:1

input4:{{0,5}}

output:10


Greedy Businesssman:

Sam is a greedy businessman who has opened N stores in a city.at various locations.

The locations of stores are stored in 1 2-Dimensional array.the coordinates of ith store are defined as follows:

starting point would be input[0][i] and ending location would be input[1][i].

for example:when i=0,input[0][0]=2 and input [1][0]=5,it means that the 0th store spans from 2 uniits to 5 units.

The greedy businessman wants to set up warehouse =s which can supply goods to these stores.

A warehouse can only be set up at a good location.A location is said to be good location if it is lying in the ranfe of [a,b],where a denotes the starting unit of a store and b denotes the end unit of any store S(a,b).

for example: a location ‘X’ is a good location with respect to the store (a,b) ifa<==X<=b.

Note:there can be more than one stores located at a particular.

Example1:

input1:2

input2:{{1,2},{3,5}}

output1:1


Write a program to take input for n number of doctor records and write records of all cardiologists in a file named: “record1”. Also write records of all those doctors in another file named: “record2” who are taking salary more than INR 80,000. After writing records in both files, merge their contents in another file: “finalrecord” and read all records of “finalrecord” file and display on screen. [Attributes of doctor: doc_id, doc_name, doc_specialization, doc_salary]

Type a number: 5

Type another number: 2

Sum is :7


Write a C++ Program to Find Grade of a Student using if else. 


Write a program to perform basic to class conversion [Such as there is a class named: "conversion" with data members: feet and inches (both int)] Convert basic type(int) height in terms of total number of inches into equivalent feet and inches (class type) and display output on screen.

Discuss constructors with default arguments and constructor overloading with the help of suitable examples



Write a program to perform basic to class conversion [Such as there is a class named: “conversion” with data members: feet and inches (both int)] Convert basic type(int) height in terms of total number of inches into equivalent feet and inches (class type) and display output on screen.


LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS