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

ABC private Ltd wants to maintain employee information.you need to define an entity class to hold employee information and generate a DLL.you also need to test this class usage by writing a console application as a client






Create Program that will compute the Final Grade from Prelim to Finals by getting its average and show the remarks. 75 is passing score. if passed, the remarks is Passed! Congratulation! otherwise Failed! Better Luck Next Time.

Declare an array that is going to store the Prelim to Finals grade using the For Loop.

ask the user to input the grade each term(Prelim, Midterm, Prefinal and Finals).

Note: In the final grade round off the average using math function.


Miss Ural wants to buy colors for Holi, and that too, at the cheapest cost!

There are N shops selling colors near Ural's house, where the i′th shop sells colors at rate of Ri for one unit. Also, i′th shop is located at a distance of Di kilometers from her house. Life was simple, but then petrol and fuel prices soared up. The current price of petrol to travel one kilometer is K

Find the minimum cost at which Miss Ural can buy one unit of color. she does not need to return back home.


  • The first line of input contains T, number of test cases in a file.
  • The next line contains two integers, N and K, as described in the problem statement.
  • The next line contains N space separated integers, denoting Di, i.e. distance of the shop.
  • The next line contains N space separated integers denoting Ri, i.e. rate of the color.


For test case, output minimum cost to purchase 1 unit of color.


  • 1≤T≤10^5
  • 1≤N≤10^5
  • Sum of N over all T in a test file does not exceed 10^6.
  • 1≤Ri,K,Di≤10^9

You are given an array of N non-negative integers: A1, A2, ..., AN. An alternating subsequence is a subsequence in which the indices of any two consecutive elements differ by exactly two in the original array. That is, if Ai1, Ai2, ..., Aik is some subsequence, then for it to be an alternating subsequence, (i2 - i1 = 2), (i3 - i2 = 2), and so on should all hold true. Among all alternating subsequences, find the one which has maximum sum of elements, and output that sum.


Input

The first line of the input contains an integer T denoting the number of test cases.


The first line of each test case contains an integer N denoting the number of elements in the array.


The second line contains N space-separated integers A1, A2, ..., AN denoting the array A.


Output

For each test case, output a single line containing the answer.


Note

A subsequence with only a single integer is also an alternating subsequence.

Constraints

1 ≤ T ≤ 10

1 ≤ N ≤ 105

0 ≤ Ai ≤ 105


  1. Find the statement that causes the compilation error.
  2. Determine the output if that statement is removed.



Class A {

public voit test () {

System.out.print("A");

}

}

Class B extends A {

public void test () {

System.out.print("B");

}

}








public class C extends A {

public void test () {

System.out.print("C");

}

public static void main (String [] args) {

A b1 = new A ();

A b2 = new C ();

b1 = (A) b2;

A b3 = (B) b2;

b1.test ();

b2.test ();

}

}


Analyze and debug the following program then display the output.

 

 

A.

#include <iostream>

using namespace std;

 

main() {

 for (int i = 0; i >= 10; i = i + 2) {

   cout << i << "\n";

 }

 return 0;

}

 

B. 

#include <iostream>

using namespace std;

 

main() {

for (int i = 0; i < 10; i++) {

if (i == 4) {

continue;

 }

cout << << "\n";

 }  

 return0;

}

 

Create a class which only works for absolute numbers, if it

encounters any negative occurrence, then it throw an exception to its

handler and display errors.


Modify the above task, by creating an exception class with an error

code and corresponding error message. Code and message should be

thrown and displayed in catch block.


Write a template function that returns the average of all the

elements of an array. The arguments to the function should be the

array name and the size of the array (type int). In main ( ), exercise the

function with arrays of type int, long, double, and char.


Write a program to swap the contents of two variables. Use

template variables as function arguments.


What types of symbols are utilized to represent the various functions?


LATEST TUTORIALS
APPROVED BY CLIENTS