## Programming 12 Question-[Solved]-

Put your programming skills to the test in these challenges.

### Programming 12 Question-[Solved]-

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.

String:
Code: Select all
`75fuy7yn2n?h7vvp03c5f@meccp?rck2#3cmdb?8edh459arsrnkl63bnj2fwoi7ji?4@i?@ip7h7n#mile8li8jugqm#1\$fvj3\$p9jm5ajixrs36\$bj#xv2fz#f@nhyg?wtrjc3t#xx?nhc?yx3ujsts\$7w#6559wsiccig@@2@qh76#w2rr#@df4#18lem#wa1fhzh?zbyig789ea7jdu\$#qpi87#o0pomhzr?3n08o@fwki9c3l15h?d3kvo1@791lm4zldde5fnycr7tepuvhkwc8pz4qtwptc72rjc9m#@vi?jn2owt@26f2ov?1lq8fnm35ef11os?sywr37d?7180amxdoqrrhx8ry0xmlzl7v0hx4b2a@dqa1z6ni1ixz2preq8x5dp\$pbw61uxs4kflkaf9c39wpwa@cghbm1?29y4pblx2\$g0faf8#qit3g5puc@2u6@8p7rer5lq9gbo95xqesttze@zugs\$g\$6foh0e8oyffk?je4f5eh@?2qq34lhin#1\$cbbnwuz4vrhbtsqva\$malor#4w7gf?jmf18v\$4qvtfpg?r?dlatou0hbbvyx6dyo8tkxvig3?tbvx41x9ws74f3dyl@q94f3vwse0ipjtzvvzq9e@`

First 25 non numerical characters:
fuyynn?hvvpcf@meccp?rck#c

First 25 non numerical characters ASCII incremented by 1:
gvzzoo@iwwqdgAnfddq@sdl\$d

Product of all Prime and Composite numbers:
3397118140620

End Result:
gvzzoo@iwwqdgAnfddq@sdl\$d3397118140620

EDIT:

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

Making the End Result:
gvzzoo@iwwqdgAnfddq@sdl\$d85264

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.
That_One_Hacker
New User

Posts: 2
Joined: Mon Jan 18, 2016 4:06 am
Blog: View Blog (0)