Question: You will have an orthogonal triangle input from a file and you need to find the maximum sum of the numbers according to given

You will have an orthogonal triangle input from a file and youneed to find the maximum sum of the numbers according togiven

You will have an orthogonal triangle input from a file and you need to find the maximum sum of the numbers according to given rules below; 1. You will start from the top and move downwards to an adjacent number as in below. 2. You are only allowed to walk downwards and diagonally. 3. You can only walk over NON PRIME NUMBERS. 4. You have to reach at the end of the pyramid as much as possible. 5. You have to treat your input as pyramid. According to above rules the maximum sum of the numbers from top to bottom in below example is 24. *1 *8 4 2*69 85 *93 As you can see this has several paths that fits the rule of NOT PRIME NUMBERS; 1>8>6>9, 1>4>6>9, 1>4>9>9 1 +8+6+9= 24. As you see 1, 8, 6, 9 are all NOT PRIME NUMBERS and walking over these yields the maximum sum. You can implement by using any programming language except Mathlab. Please paste the link to your code. Yantnz girin

Step by Step Solution

3.51 Rating (151 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Step 1 Program Plan Define checkPrime function to check whether a number is a prime number or not ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Accounting Questions!