Programming 12 Question-[Solved]-

Put your programming skills to the test in these challenges.

Programming 12 Question-[Solved]-

Post by That_One_Hacker on Sun Jan 31, 2016 11:35 pm
([msg=91453]see Programming 12 Question-[Solved]-[/msg])

I have been working on the Programming 12 challenge today and I went to submit the answer and it keeps telling me the answer is wrong.

I just want to make sure I am making the right calculations for this challenge. What I have been doing is separating the prime and composite numbers (No 1 or 0, Each number as a single digit since the instructions say assume the numbers will be single digits), adding every prime number together separately from the composite numbers, adding every composite number together separately then multiplying those 2 numbers together. Then for adding the 25 character string, I weed out all the numbers since it says non-numerical string (I assume that means to keep the special characters as well), increase the ASCII values by 1 and concat the product of the prime and composite numbers to the end of that string (no spaces between them).

I think I have been doing each step correctly but maybe I am missing something. I have output from my program from some of the steps that displays what is happening and it seems to be working as expected.

Am I supposed to be calculating the numbers as they appear instead of only single digit numbers?

Can anybody see anything wrong with the way I calculated the result?

Here's some information for one that I submitted that returned as wrong.

Code: Select all

First 25 non numerical characters:

First 25 non numerical characters ASCII incremented by 1:

Product of all Prime and Composite numbers:

End Result:


I found an error in my code that was resulting in a high product. After changing, the new product would be:

Making the End Result:

After testing this on the challenge (With a new string of course), it still had no effect.

-- Mon Feb 01, 2016 12:48 am --

Haha I see what I did now. I had 9 as a Prime number and 2 as a Composite number. Submitted the new results after changing that and it worked.
New User
New User
Posts: 2
Joined: Mon Jan 18, 2016 4:06 am
Blog: View Blog (0)

Return to Programming

Who is online

Users browsing this forum: No registered users and 0 guests