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 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.


Write a C++ program that displays the row numbers of a matrix containing at least two prime numbers. First, the program should create a 2D array (5 rows, 5 columns). Then, ask the user to input values in the matrix or 2D array. After that, program should display row number (or index) which has at least two prime numbers. If no row (of the matrix) contains at least two prime numbers then the program should display the message “No row found containing two prime numbers”.

Write a program that mimics a calculator. The program should take as input two integers and the operation

to be performed.

It should then output the numbers, the operator, and the result. (For division, if the denominator is zero,

output an appropriate message.)

Some sample outputs are as follow:

3 + 4 = 7

13 * 5 = 65


1. Write a complete C++ application to prompt the user for the double voltage and resistance of a circuit, and call function calcurrent to calculate and display the current of the circuit.

Use the following statement to calculate the current:

 

double current = voltage / resistance

 

 

2. Write a C++ program to calculate the product of all even numbers from 1 to 13 using a for loop.

 

 

 

 

3. Write a C++ Program to generate a random from the following list of numbers

 


  1. 1 to 535 (one from the list)
  2. -14 to 190 (one from the list)
  3. 12, 24, 36, 48, 60 (one from the list)
  4. 0 to 241 (one from the list)
  5. 42 to 90 (one from the list)


Put the above statements in a C++ program and run the program and print the generated numbers


Write a program that takes length as input in feet and inches and convert it into centimeters. Using the constant for declaration of conversion constants. To calculate the equivalent length in centimeters, you need to multiply the total inches by 2.54. Similarly, to find the total inches, you need to multiply the feet by 12 and add the inches. 


Write a program that takes length as input in feet and inches and convert it into centimeters. Using the constant for declaration of conversion constants. To calculate the equivalent length in centimeters, you need to multiply the total inches by 2.54. Similarly, to find the total inches, you need to multiply the feet by 12 and add the inches. 


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]

write a c++ programe which calculates sum of each column and row separately .for this, first create a 2D array 3 rows , 5 columns and then ask the user to input values in the array . after that , first calculate sum of each row separately and display that sum. then calculate sum of each column separatel and display that sum on the screen. to achieve such output , ou need to follow the following instructions?


planting trees:

In planting field, there are trees in a single row fromleft to right.each tree has avalue V.youcut trees fromleft to right and for each tree ofvalue Vthat you cut,youplant(V+1)% M trees on the right most end with values ranging from 0 to ((V+1)%M)-1.

Initially,there was only one tree with value 2.Find the total number of trees present after cutting K trees.

Example:

Input1:1

Input2:2

Output1:1 


Harrypotter is visiting his uncle’s house ,the house of Black ,and ants to know more about the family through their ancestral tree.He notices that the ancestraltreebegins with the head of the family at the top,having 2 children as his descendants,This pattern is followed throught and each member is represented by unique integer.

Given relationships in the form ofan integer arraywhere the head of the family is at the first position (i=0) and his children areat position (2*i+1) and (2*i+2).

Your task is to help harry find and return all the siblings of any given family member and return them in the form of a sorted array.

Note:if there are no siblings ,return {-1}.

Example:

Input1:5

Input2:{1,2,3,4,5}

Input3:1

Output:{-1}


LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS