This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
user:acrowle1:portfolio:cprogproject3 [2014/03/02 22:04] – [Reflection] acrowle1 | user:acrowle1:portfolio:cprogproject3 [2014/03/09 14:53] (current) – [Project: dayofweek] acrowle1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ======Project: | + | ======Project: |
A project for CSCS1320S14 by Alana Whittier during the Spring Semester 2014. | A project for CSCS1320S14 by Alana Whittier during the Spring Semester 2014. | ||
Line 50: | Line 50: | ||
My first attempt at writing the program was using the modulus operator, %, although abandoned that effort quickly as it was not clear what to do with the factor in order to implement the mental math technique. I then decided to implement the computation of the square in what I deemed more simplistic of an approach and then used a series of if, else if statements to output **// | My first attempt at writing the program was using the modulus operator, %, although abandoned that effort quickly as it was not clear what to do with the factor in order to implement the mental math technique. I then decided to implement the computation of the square in what I deemed more simplistic of an approach and then used a series of if, else if statements to output **// | ||
- | Example 1: | + | Example 1 (My first submitted program): |
Line 94: | Line 94: | ||
After more consideration, | After more consideration, | ||
- | See the code below. | + | Example 2 (The second program using modulus operator and factor): |
Line 211: | Line 211: | ||
Second mistake: The way I used the curly braces. Essentially, | Second mistake: The way I used the curly braces. Essentially, | ||
- | Since my initial attempt at writing this program included the modulus operator, which had been quickly abandoned, I decided to revisit that since I now had a working program written in a manner I felt was more simplistic. What I realized that I was missing from my initial program was the factor (the number of times that 10 went into the integer). For example, if I said the factor | + | Since my initial attempt at writing this program included the modulus operator, which had been quickly abandoned, I decided to revisit that since I now had a working program written in a manner I felt was more simplistic. What I realized that I was missing from my initial program was the factor (the number of times that 10 went into the integer). For example, if I declared |
Line 227: | Line 227: | ||
In performing this project, the following resources were referenced: | In performing this project, the following resources were referenced: | ||
- | * http://en.cppreference.com/w/cpp/language/types1 | + | * http://wildaboutmath.com/2007/11/11/impress-your-friends-with-mental-math-tricks/comment-page-6/ |
- | * http://www.youtube.com/ | + | * http://saurabhg.hubpages.com/hub/ |
- | * http://www.binaryhexconverter.com/decimal-to-hex-converter | + | * Kernighan, Ritchie |
- | * http://en.wikipedia.org/wiki/Signed_number_representations | + | * email consultations and guidance from Matt Haas |