subject

The function/method accepts one argument: inputString, a string representing an input string that consists of English alphabets and digits (0-9) only. The function/method returns a positive integer representing the sum of the numbers in the inputString. The sequence of consecutive digits is considered as one number The code compiles successfully but fails to return the desired result for some test cases because of an incorrect implementation of the function/method . Your task is to fix the code so that it passes all the test cases. You are required to fix all the logical error in the given code. You can click on Compile & Run anytime to check the compilation/execution status of the program. You can use cout to debug your code. The submitted code should be logically/syntactically correct and pass all testcases. Do not write the main() function as it is not required. Code Approach: For this question, you will need to complete the code as in given implementation. We do not expect you to modify the approach. 6 1 int (int size , int* arr, int tripletsum) 2 - { 3 int count = 0; 4 for(int i = 0; i < size - 2; i++) 5 - { if (tripletSum % arr[i] == 0) 7- { 8 for (int j =0 ; j < size 1; j++) 9 { 10 if (tripletSum % (arr[i] arr[j]) 0) 11 { 12 int value = tripletsum /(arr[i] * arr[j]); 13 for(int k = j +1; k < size ; k++ ) 14 if (arr[k] == value) 15 count++; } 17 == 16 The function/method count TripletSumPermutations accepts three arguments: size, an integer representing the size of the list; arr, representing the list of integers; tripletSum, an integer representing the value to compare. The function/method returns an integer representing the number of triplets from the list whose product is equal to the given tripletSum. The code compiles successfully but fails to return the desired result for some test cases because of an incorrect implementation of the function/method . Your task is to fix the code so that it passes all the test cases. } 18 19 20 } return count; 21 }

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 23:00
Explain briefly why you cannot expect to find a previous version of every file with which you work.
Answers: 1
question
Computers and Technology, 22.06.2019 15:30
Whats are the different parts of no verbal comunication, especially body language?
Answers: 3
question
Computers and Technology, 22.06.2019 17:00
Aisha has finished working on a word processing document that contains 15 pages. she has added some special elements in the first three pages, page 9 and 10, and page 15 from the document. she wants to print only these pages to see how they look. which option is the correct way to represent (in the print dialog box) the pages that aisha wants to print
Answers: 3
question
Computers and Technology, 23.06.2019 14:00
Select the correct answer. a company is currently focusing on creating specific management goals for itself. which level of maturity is the company demonstrating under the sse_ccm framework? a. performed informally b. planned and tracked c. quantitatively controlled d. well-defined e. continuously improving
Answers: 2
You know the right answer?
The function/method accepts one argument: inputString, a string representing an input string that c...
Questions
question
Biology, 23.06.2019 10:10
question
Mathematics, 23.06.2019 10:10
Questions on the website: 13722360