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, 22.06.2019 17:00
Annie is creating a corporate report for a company’s annual meeting. in the report, she wants to add the signature of various department heads. which device can annie use to capture signatures to include in the report? a. printer b. monitor c. e-reader d. digitizing tablet
Answers: 1
question
Computers and Technology, 23.06.2019 00:00
How do we use the sumif formula (when dealing with different formats) ?
Answers: 1
question
Computers and Technology, 23.06.2019 18:30
How often does colleges update the cost of attendance on their website? . a)every two years b) every four years c) every year d) every semester
Answers: 1
question
Computers and Technology, 24.06.2019 01:00
Verify each identity[tex] \frac{csc}{cot \: x \: + \: tan \: x} = cos \: x[/tex]
Answers: 1
You know the right answer?
The function/method accepts one argument: inputString, a string representing an input string that c...
Questions
question
Mathematics, 06.07.2019 22:30
question
Chemistry, 06.07.2019 22:30
Questions on the website: 13722360