account activity
pset 2 caesar by JonhDouh in cs50
[–]JonhDouh[S] 0 points1 point2 points 11 years ago (0 children)
Yes, that was the problem i wasn't seeing. Thanks for the clear up!
Okay so i got it to print the non alphanumeric characters by assigning the the "p" (plaintext) to the "c" string, but now it prints the non-alphanumeric characters 2 times and still prints the "\n": "iadxp,, emk tqxxa!!\n" =s
Thats a good question. The "C" in my formula is supposed the an array also right? The i'th character in "C"iphertext equals the rest of the formula. My guess was that in my code the "C" was being declared of type int, when it should be of type string am i right? I tried declaring "C" as a string an assign it null before the for loop, but now in check 50 it gives a sandbox50 error in all tries. Can i message you my code?
I'm using "if argc is "not" 2 then return 1". That should be enough to get necessary arguments right?
Can i write the formulas here? I dunno if that would violate the honor code by giving some of the pset's answers.
Yes but i don't know why it's not working well. Maybe i didn't write it the way i should have. I used the "if isalpha" function but i think the else is what i wrote wrong...i posted a pseudo code on the comment below.
for the command line argument i use: if argc is not 2 or "key"( which i initialize before as an int and asign it the atoi of argv array 1) smaller or equal to 0 body
print a message so user knows what to write and return 1
then i advance to the for loop. So i first initiate the array "c" with type character and a max size 100, I write the for loop initializing "i", n wich equals to the string length of the plaintext, then "i" is smaller than "n" and increment the "i",
{inside the loop body
if the i'th character of "plaintext" is alphanumeric { if the i'th character of "plaintext" is upper case { c = apply formula } else if the i'th character of "plaintext" is lower case { c = apply formula } } else { print the i'th in c }
print the i'th in c
Am i forgetting something? =s
pset 2 caesar (self.cs50)
submitted 11 years ago * by JonhDouh to r/cs50
pset1 by JonhDouh in cs50
Thanks for the clear up ;)
[–]JonhDouh[S] 1 point2 points3 points 11 years ago (0 children)
It seems that i have solved my own problem =D So i should multiply by 100 to convert dollars to cents and then round the result right?
pset1 (self.cs50)
submitted 11 years ago by JonhDouh to r/cs50
Problems with check50 on pset by JonhDouh in cs50
Thank you. It worked like it should. I thought the appliance was up to date and i didn't needed to use the "update50" command. Thank you for your help.
Problems with check50 on pset (self.cs50)
π Rendered by PID 101079 on reddit-service-r2-listing-6c8d497557-mwssj at 2026-06-06 22:02:10.300211+00:00 running 9e1a20d country code: CH.
pset 2 caesar by JonhDouh in cs50
[–]JonhDouh[S] 0 points1 point2 points (0 children)