Programming & Computer Science Answers

C++ 9913
Python 5288
Java | JSP | JSF 3611
C 1680
C# 1362
Computer Networks 989
Algorithms 652
Databases | SQL | Oracle | MS Access 641
HTML/JavaScript Web Application 588
Other 537
Visual Basic 358
Assembler 209
Software Engineering 202
AJAX | JavaScript | HTML | PHP 166
MatLAB 150
MatLAB | Mathematica | MathCAD | Maple 124
Action Script | Flash | Flex | ColdFusion 112
UNIX/Linux Programming 89
Web Development 73
Excel 36
ASP | ASP.NET 23
Delphi | Pascal 21
Perl 16
Prolog 9
Functional Programming 9
MathCAD 5
Wolfram Mathematica 4
WPF 4
Ruby | Ruby on Rails 3
NodeJS Web Application 2

Questions answered by Experts: 26 876

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

single digit number

input - the input is a single line containing a positive integer N.


output - the output should be a single line containing a single-numeral number.






Discuss the information that the operating system stores on processes in its Process Control Block.



A function that takes two integers as inputs and sets the numerator and denominator of the fraction object. The function should check that the denominator is not zero and set the fraction to 0 over 1 if the denominator is zero.

A print function that prints a fraction object as an improper fraction, e.g. 6/4.

A print function that prints a fraction object as a mixed number, e.g. 1 2/4.

A print function that prints a fraction object as a decimal, e.g. 1.5. Each of these print functions should have a different name.

. Or you could overload the + operator to add fractions.

A subtract function that subtracts two fractions. Or overload the - operator to subtract fractions.A multiply function that multiplies two fractions. Or overload the * operator to multiply fractions.A divide function that divides two fractions. Or overload the / operator to divide fractions.To test the fraction class, create at least three different fraction objects and use these instances to test all of the above functions


Difficult Addition

Arjun is trying to add two numbers. Since he has learned addition recently, an addition which requires a carry is difficult for him. Your task is to print Easy if the addition does not involve a carry, Otherwise print Hard.


Input

The first line of input contains two space separated integers A and B.


Output

If the addition does not involve a carry,print Easy, otherwise print Hard.




Explanation

When calculating 229 + 390, we have a carry from the tens digit to the hundreds digit, so the answer is Hard.


Sample Input1

123456789 9876543218

Sample Output1

Easy


Sample Input2

229 390

Sample Output2

Hard


Write a function solution that given a three digit integer N and Integer K, returns the maximum possible three digit value that can be obtained by performing at most K increases by 1 of any digit in N





Wrte a C++ program that will receive your full names as strings from the screen and display every character of the string with ASCII value.








1. Three Char Apart



by CodeChum Admin




Do you like reading books? If you do, then you must have encountered texts that have quite a wide space with dots in between them, just like pausing or thinking before proceeding the narration. Let’s try doing that here in C, shall we?




Input




1. First character




2. Second character




Output




The first line will contain a message prompt to input the first character.



The second line will contain a message prompt to input the second character.



The succeeding lines contain the 2 characters separated by dots.

1. Which of the following statement is not correct about k-means?

 


a)Accuracy of cluster are improved by scaling of attributes.

b)K-means clusters are affected by outliers.

c)K-Means clustering is NOT influenced by initial centroids which are called cluster seeds

d)Number of clusters to be built is typically an user input and it impacts the way clusters are created


Write a function that take a number and return the previous and next numbers of the

first parameter passed. (Write codes for the main function also.)




You are given an array of N non-negative integers: A1A2, ..., 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 Ai1Ai2, ..., 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 A1A2, ..., AN denoting the array A.

Constraints

  • 1 ≤ T ≤ 10
  • 1 ≤ N ≤ 105
  • 0 ≤ Ai ≤ 105

Scoring Information

  • 20% score for N ≤ 100
  • 30% score for N ≤ 1000
  • 50% score for N ≤ 105
LATEST TUTORIALS
APPROVED BY CLIENTS