You will have an orthogonal triangle input from a file and you need to find the...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
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. Yanıtınızı girin 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. Yanıtınızı girin
Expert Answer:
Answer rating: 100% (QA)
Step 1 Program Plan Define checkPrime function to check whether a number is a prime number or not ... View the full answer
Related Book For
Posted Date:
Students also viewed these accounting questions
-
Who benefited from the pause in the global trade of goods and services between WWI and WWII? O Domestic producers. O Domestic consumers. International shipping companies. Tariff revenue.
-
Write a program that reads a connected graph from a file and displays its minimum spanning tree. The first line in the file contains a number that indicates the number of vertices (n). The vertices...
-
Use MATLAB to find the maximum percent overshoot, peak time, 2% settling time, and 100% rise time for the following equation. The initial conditions are zero. x + 4 x + 8x = 2u s (t)
-
Explain how teacher knowledge of context impacts the development of meaningful learning and teaching for any particular group of young children. Cite at least three relevant sources from the...
-
What are zoning laws? How do they affect the location decision?
-
The following information pertains to the financial statements of Buffalo Supply Company, a provider of plumbing fixtures to contractors in central Pennsylvania. Required: Reconstruct all journal...
-
The Racial Divide The website http://vallandingham.me/racial_divide/\#pt uses data from the US Census to visualize where whites and blacks live in different cities. Figure 2.98 gives a heat map of...
-
Waterways Tours uses the units-of-activity method in depreciating its tour boats. One boat was purchased on January 1, 2006, at a cost of $148,000. Over its four-year useful life, the boat is...
-
Molander Corporation is a distributor of a sun umbrella used at resort hotels. Data concerning the next month's budget appear below: Selling price per unit Variable expense per unit Fixed expense per...
-
The assets, labilities, and equities of Dundee Design Studio have the following balances at December 31, 2024. The Retained Earnings was $31,000 at the beginning of the year. At year end, Common...
-
1. Identify decision Under uncertainty: a. Maximax Criterion = b. Maximin Criterion = c. Laplace Criterion/Equally likely Criterion = d. Minimax Regret Criterion = 2. Identify decision Under risk...
-
The financial manager Katrina Sdn Bhd, a manufacturing firm, has decided to seek a line of credit from the Alliance Bank. This additional source of funds is needed to support a large portion of the...
-
Calculate the total returns (TR) and the return relatives (RR) in term of Euro for the following assets: i. A preferred stock bought for 70 per share, held one year during which 5 per dividend are...
-
Given that Rahn and Deepa want to equally own the new property, claim taxation benefits and maintain ownership if one party passes away, how should they register their ownership interest on the...
-
Cash flows are an important indicator of a company's financial health. What is cash flow and what would you do if your company continued to run negative cash flow every quarter? How would you fix the...
-
Briefly discuss the Quantitative and Qualitative methods for forecasting.
-
Air with a free stream velocity of 25 m/s flows over a 6 m long by 2 m wide flat plate. A mixed boundary layer is formed on the surface of the plate at a transition point Re=500,000. (a) Find the...
-
In the figure, two loudspeakers, separated by a distance of d1 = 2.63 m, are in phase. Assume the amplitudes of the sound from the speakers are approximately the same at the position of a listener,...
-
Implement a class LoginForm that simulates a login form that you find on many web pages. Supply methods public void input(String text) public void click(String button) public boolean loggedIn() The...
-
Mean and standard deviation. Write a program that reads a set of floating-point data values. Choose an appropriate mechanism for prompting for the end of the data set. When all values have been read,...
-
Write a program that prints a face similar to (but different from) the following: (| 00 |)
-
We may use Eq. (11.16) to generate sample paths of the generalized Wiener process by Monte Carlo sampling. We rewrite the equation for a small time step , and express the increment of the Wiener...
-
Consider a set of \(m\) assets, whose prices are modeled by stochastic processes , described by stochastic differential equations like (11.18). Let us assume that we pursue a portfolio strategy...
-
In order to apply It's lemma to the computation of the stochastic integral Data From Eq. (11.32) Data From Eq. (11.30) T W+dWt,
Study smarter with the SolutionInn App