User Tools

Site Tools


haas:spring2014:cprog:projects:dayofweek

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
haas:spring2014:cprog:projects:dayofweek [2014/01/17 08:24] – [Program] wedgehaas:spring2014:cprog:projects:dayofweek [2014/02/06 17:39] (current) – [Reflection] wedge
Line 1: Line 1:
 +<WRAP centeralign round box>
 +<WRAP><color red><fs 200%>Corning Community College</fs></color></WRAP>
 +<WRAP><fs 150%>CSCS1320 C/C++ Programming</fs></WRAP>
 +</WRAP>
 +
 +~~TOC~~
 +
 ======Project: MENTAL MATH (DAY OF WEEK)====== ======Project: MENTAL MATH (DAY OF WEEK)======
  
-A project for C/C++ Programming. 
 =====Objective===== =====Objective=====
 To implement a programmatic solution (ie simulation) of a real life process- the mental math trick of determining what day of the week January 1 of any given year (in the 21st century) falls on. To implement a programmatic solution (ie simulation) of a real life process- the mental math trick of determining what day of the week January 1 of any given year (in the 21st century) falls on.
  
-=====Prerequisites=====+======Assumptions====== 
 + 
 +To assist you in completing this project, you may make the following assumptions: 
 + 
 +  * all requests will be for days in the 21st century (2000-2099) 
 +=====Prerequisites/Corequisites=====
 In addition to the new skills required on previous projects, to successfully accomplish/perform this project, the listed resources/experiences need to be consulted/achieved: In addition to the new skills required on previous projects, to successfully accomplish/perform this project, the listed resources/experiences need to be consulted/achieved:
  
Line 30: Line 41:
 In our example, we're working with 2014, the last two digits are therefore: 14 In our example, we're working with 2014, the last two digits are therefore: 14
  
-You should be able to come up with a means of extracting this information.+You should be able to come up with a means of extracting this information in your program.
  
 ===Step 2: Compute 25% (drop the decimal)=== ===Step 2: Compute 25% (drop the decimal)===
Line 79: Line 90:
  
 Go and reference the 3 from that table... what day do we get? Does it match the actual day of the week for January 1st, 2014? Go and reference the 3 from that table... what day do we get? Does it match the actual day of the week for January 1st, 2014?
 +
 +<cli>
 +lab46:~$ cal 01 2014
 +    January 2014
 +Su Mo Tu We Th Fr Sa
 +          1  2  3  4
 +  6  7  8  9 10 11
 +12 13 14 15 16 17 18
 +19 20 21 22 23 24 25
 +26 27 28 29 30 31
 +
 +lab46:~$ 
 +</cli>
  
 Pretty neat, eh? Pretty neat, eh?
Line 97: Line 121:
  
 <cli> <cli>
-lab46:~/src/cprog/squares$ ./squares +lab46:~/src/cprog/dayofweek$ ./dayofweek 
-Enter value75 +Which year2014 
-75 x 75 = 5625 +January 1st, 2014 falls on: Wednesday 
-lab46:~/src/cprog/squares+lab46:~/src/cprog/dayofweek
 </cli> </cli>
  
Line 108: Line 132:
 Be sure to provide any commentary on your opus regarding realizations had and discoveries made during your pursuit of this project. Be sure to provide any commentary on your opus regarding realizations had and discoveries made during your pursuit of this project.
  
-  * Does this trick work (or can it be adapted to work) for three digit values ending with 5+  * 2000 by definition isn't a leap year, but how does this algorithm work for 2000 in general
-  * How about 4 digits?+  * Try this algorithm on some years in the 20th century and see how it fares. 
 +    * Is it correct? Is it correct for any of them? 
 +    * If it isn't correct, is it consistently off by a value?
  
 +This isn't just about implementing a particular algorithm, it is about understanding an algorithm- its domain of correctness, and its limitations.
 =====Submission===== =====Submission=====
 To successfully complete this project, the following criteria must be met: To successfully complete this project, the following criteria must be met:
Line 128: Line 155:
  
 <cli> <cli>
-$ submit cprog squares squares.c +$ submit cprog dayofweek dayofweek.c 
-Submitting cprog project "squares": +Submitting cprog project "dayofweek": 
-    -> squares.c(OK)+    -> dayofweek.c(OK)
  
 SUCCESSFULLY SUBMITTED SUCCESSFULLY SUBMITTED
Line 137: Line 164:
 You should get some sort of confirmation indicating successful submission if all went according to plan. If not, check for typos and or locational mismatches. You should get some sort of confirmation indicating successful submission if all went according to plan. If not, check for typos and or locational mismatches.
  
-====Verify submission==== 
-To verify you submitted successfully, you may run the following (from anywhere on lab46): 
- 
-<cli> 
-lab46:~$ verify cprog squares 
-squares: submitted successfully 
-</cli> 
  
-Note if automated assessment is available for the project, you may actually see results in the output as well. 
haas/spring2014/cprog/projects/dayofweek.1389947055.txt.gz · Last modified: 2014/01/17 08:24 by wedge