X C Write A Program To. x. M One Drive x + -ox Poly U HKCC Home x CPCE Portal X Microsoft PowerPoint X Repl.it Afraid Taut X SEHH2042_midsm C moodle.cpce...

X C Write A Program To. x. M One Drive x + -ox Poly U HKCC Home x CPCE Portal X Microsoft PowerPoint X Repl.it Afraid Taut X SEHH2042_midsm C moodle.cpce polyu.edu.hk/pluginfile.php/4857213/mod_resource/content/2/SEHH2042_midAsm.pdf + Question 3 (25%) Suppose that there are n integer numbers x, X.... following table. Whose values are determined by the 5 digit of your student ID Odd Values of the n numbers x = 20° +10i -20, for all i -1,2,...,/. x = 151° +1 li-3, for all i=1, 2, Even From the numbers above, we want to select (without replacement) three numbers to be the sides of a triangle. The three numbers can form a triangle only if the sum of every two numbers is larger than the value of the remaining number. We say that these three numbers are in a triangular group. Write a program that accepts an input n, which is a positive integer at least 3. It then outputs the number of triangular groups that can be formed among the numbers X. X...... User inputs: 1. An integer n (at least 3) Program outputs: 1. Number of triangular groups can be formed Sample display (for odd) Sample display for even) 10 10 18 Remark: The ordering of the numbers in a group does not matter. For example, 3, 4, 5 and 5, 4,3 are considered the same group. Olet XTR

May 19, 2022
SOLUTION.PDF

Get Answer To This Question

Submit New Assignment

Copy and Paste Your Assignment Here