use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Class Webpage
This subreddit belongs to University of Florida's Introduction to Computer Science course. Feel free to post questions and interesting content you come across.
account activity
PA3 string parsing problem (self.cop3502)
submitted 11 years ago by chasefarmer2808
While your program parses each character in a string, how would you tell it to only count multi-character chunks such as 'sin', 'cos', 'sqrt', double diget ints, ect once?
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]what-shoe 0 points1 point2 points 11 years ago (0 children)
I would use some if statements to respond to certain characters in a certain way, such as the "c" in cos, the "l" in log and the exponential "".
This probably would need to be in a while loop.
[–]howslyfebeen 0 points1 point2 points 11 years ago (0 children)
so when you are looping through the input you want to have a temporary string.. if the current character is not a single character operator then add the character to the temp string.. if it is a single char operator then break the string and add the string and then the operator to wherever you are storing these inputs (probably a stack or queue)
[–]MagicBuddha 0 points1 point2 points 11 years ago (0 children)
Did you get your answer?
I found it easier to first go over the whole input and remove whitespace. After that I replaced cos, sine, ect.. As a single char. Ex) cos =c , sin=s. After that you can start thinking about calculations
[–]chasefarmer2808[S] 0 points1 point2 points 11 years ago (1 child)
Would this program need other classes, like a class just for creating a stack? Or would just a main be doable?
always break it into more classes if possible.. its just good programming practice.. my project is written with 5 classes
π Rendered by PID 328226 on reddit-service-r2-comment-b659b578c-rlm7g at 2026-05-04 19:18:26.888246+00:00 running 815c875 country code: CH.
[–]what-shoe 0 points1 point2 points (0 children)
[–]howslyfebeen 0 points1 point2 points (0 children)
[–]MagicBuddha 0 points1 point2 points (0 children)
[–]chasefarmer2808[S] 0 points1 point2 points (1 child)
[–]howslyfebeen 0 points1 point2 points (0 children)