Questions: 1 680

Answers by our Experts: 1 680

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

A class octopus has a dummy head which has four pointers – left, right, top and bottom. You have to build link list in these 4 directions depending on the input commands. There will be four types of commands – L, R, T and B. Their specifications are given below:

L x: insert x in the left link list // Where x is an integer number.

R x: insert x in the right link list

T x: insert x in the top link list

B x: insert x in the bottom link list

Input: Test case will start with a number n indicating the number of lines following it.

Output: you have to give output that which link list (Left, Right, Top and Bottom) has maximum sum of values. See the sample input and output.

Sample input

14

L 3

L 15

L 1

R 17

T 9

T 10

B 13

T 5

L 8

R 3

R 12

B 2

B 3

B 4

Sample output

Right Link List Has Maximum Sum 32


write a program to initialize the value as 5.800000 & display the value on the monitor?


Victor has an array of size n. He loves to play with these n numbers. Each time he plays

with them, he picks up any two consecutive numbers and adds them. On adding both the

numbers, it costs him k*(sum of both numbers).

Find the minimum cost of adding all the numbers in the array.

Input Specification:

input1: Size of array.

input2: Elements of the array.

input3: Value of k.

Output Specification:

Return the minimum cost of adding all the numbers of the array.


Suppose a company “ABC” is conducting a test to hire you as OOP Developer and asked you develop a calculator for the basic Arithmetic operators (+, -, *, /, %), where you have to deal at least 11 digit numbers. The numbers can be of with decimal point or without decimal point. The company wants you to develop an efficient code. You can choose any of the following options to develop this whole scenario:


  •       Function Overloading            
  •      Class Template

You have to answer, which option will you choose and arguments in favour of your chosen option regarding code efficiency, code complexity and other factors.



Newton's law states that the force, F, between two bodies of masses My and M₂ is given by:

F = k(m1m2)/d
The roots of the quadratic equation ax
Newton's law states that the force, F, between two bodies of masses My and M₂ is given by:

F = k(MM).

in which is the gravitational constant and d is the distance between the bodies. The value of k is approximately 6.67x10" dyn, cn/g Write a program that prompts the user to input the masses of the bodies and the distance between the bodies. The program then outputs the force between the bodies.

Given an unsorted dynamic array (arr) and two numbers x and y, find the minimum distance between x and y in the array (arr) using functions. The array might also contain duplicates. You may assume that both x and y are different and present in the array (arr). You are also advised to NOT use the INT_MAX and abs() function.


Sample Input & Output

Input: arr[ ] = {3, 5, 4, 2, 6, 5, 6, 6, 5, 4, 8, 3}, x = 3, y = 6

Output: Minimum distance between 3 and 6 is 4

(3 to 5 => 1 unit, 5 to 4 => 1 unit, 4 to 2 => 1unit & 2 to 6 => 1 unit

So, Total Minimum Distance = 1+1+1+1 = 4)


write a C program to count the number of zero elements in a two dimensional matrix using function with 2D array as an argument

Sample input:

12 0 38

4 3 0

7 0 9

No of zero elements:3


Interest on a credit card's unpaid balance is calculated using the average daily balance. Suppose that netBalance is the balance shown in the bill, payment is the payment made, d1 is the number of days in the billing cycle, and 2 is the number of days payment is made before billing cycle. Then, the average daily balance isc

average Daily Balance (net Balance" di-payment d2)/d1

If the interest rate per month is, say, 0.0152, then the interest on the unpaid balance is

interest average DailyBalance 0.0152

Write a program that accepts as input netBalance, payment, d1, 2, and interest rate per month. The program outputs the interest. Format your output to two decimal places.
LATEST TUTORIALS
APPROVED BY CLIENTS