User Tools

Site Tools


user:acrowle1:portfolio:cprogproject3

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
user:acrowle1:portfolio:cprogproject3 [2014/03/02 22:23] – [Procedure] acrowle1user:acrowle1:portfolio:cprogproject3 [2014/03/09 14:53] (current) – [Project: dayofweek] acrowle1
Line 1: Line 1:
-======Project: squares======+======Project: Squares======
  
 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 211: Line 211:
 Second mistake: The way I used the curly braces. Essentially, I was embedding several else if statements within the initial if. By correcting this my code worked flawlessly. Second mistake: The way I used the curly braces. Essentially, I was embedding several else if statements within the initial if. By correcting this my code worked flawlessly.
  
-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 the factor to be i/10 and R= i%10, then for an integer value of 25, R=5 and the factor=2, since 10 can go into 25 twice, with a remainder of 5. With this program written this way, the same mental math technique works for 3 and 4 digit integers ending in 5 as well, to compute the squares. This code is shown above as the second method in the Procedure section.    +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 the factor to be i/10 and R= i%10, then for an integer value of 25, R=5 and the factor=2, since 10 can go into 25 twice, with a remainder of 5. With this program written this way, the same mental math technique works for 3 and 4 digit integers ending in 5 as well, to compute the squares. This code is shown above in Example 2 of the Procedure section.    
  
  
user/acrowle1/portfolio/cprogproject3.1393798997.txt.gz · Last modified: 2014/03/02 22:23 by acrowle1