<!DOCTYPE html>
<!-- saved from url=(0094)https://content.byui.edu/file/cddfb9c0-a825-4cfe-9858-28d5b4c218fe/1/Ponder/124.06.Ponder.html -->
<html lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    
        <title>Project 06 : Calendar</title>
    <link href="./Project 06 _ Calendar_files/styles.css" rel="stylesheet" type="text/css">
</head>
<body style="">
  <div id="main" class="splash">
    <div id="header">
       <img class="banner" alt="CS 124 Banner" title="CS 124 Banner" src="./Project 06 _ Calendar_files/124.2.Banner.jpg">
    </div> <!-- id="header" -->

    <article>

        <h1>Project 06 : Calendar</h1>
        <h5>Due Saturday at 5:00 PM MST</h5>
      
        <p>The second part of the Calendar Program project (the first part being the structure part due earlier)
          is to write the pseudocode for two functions: <code>computeOffset()</code> and <code>displayTable()</code>.</p>
        
        <h3>Compute Offset</h3>
        <p>Write the pseudocode for the function <code>computeOffset()</code>.  
                This function will determine the day of the week of the first day of the month by counting how many days 
                have passed since the 1st of January, 1753 (which is a Monday and <code>offset == 0</code>).  
                That number (<code>numDays</code>) divided by 7 will tell us how many weeks have passed.  
                The remainder will tell us the offset from Monday.  
                For example, if the month begins on a Thursday, then <code>offset == 3</code>. 
                The prototype for the function is:</p>
                                <div class="code"><code>int computeOffset(int month, int year);</code></div>
                 <p>Please do not plagiarize this from the internet; you must use a loop to solve the problem.</p>
         <p>The output for this function is the following:</p>
        <table class="content">
           <tbody>
             <tr> <th>Day      </th> <th><code>offset</code></th></tr> 
             <tr> <td>Sunday   </td> <td>6                       </td> </tr>
             <tr> <td>Monday   </td> <td>0                       </td> </tr>
             <tr> <td>Tuesday  </td> <td>1                       </td> </tr>
             <tr> <td>Wednesday</td> <td>2                       </td> </tr>
             <tr> <td>Thursday </td> <td>3                       </td> </tr>
             <tr> <td>Friday   </td> <td>4                       </td> </tr>
             <tr> <td>Saturday </td> <td>5                       </td> </tr>
           </tbody>
        </table>
        
        <p>You might want to test your algorithm (and get ahead on the next installment of the project)
                by also writing the code in C++ and testing it with a driver program.
            For example, we know that the January 1<sup>st</sup> 1753 is a Monday.
            Therefore, your driver program should output:</p>
<pre>Enter a month number: <span class="input">1</span>
Enter year: <span class="input">1753</span>
Offset: 0
</pre>
      <p>The second is the 1<sup>st</sup> of August, 2001 which is a Wednesday.</p>
<pre>Enter a month number: <span class="input">8</span>
Enter year: <span class="input">2001</span>
Offset: 2
</pre>
    
    
       <h3>Display Table</h3>
       <p>Write the pseudocode for the function <code>displayTable()</code>.  
        This function will take the number of days in a month (<code>numDays</code>) and the offset (<code>offset</code>) 
        as parameters and will display the calendar table.  
        For example, consider <code>numDays == 30</code> and <code>offset == 3</code>. The output would be:</p>
<pre>  Su  Mo  Tu  We  Th  Fr  Sa
                   1   2   3
   4   5   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
</pre>
         <p>There are two problems you must solve: how to put the spaces before the first day of the month, and how to 
                put the newline character at the end of the week.  The prototype of the function is:</p>
                                <div class="code"><code>void displayTable(int offset, int numDays);</code></div>
     <p>You may wish to verify your solution by writing code. 
        This is part of Assignment 2.5</p>
           

     <h2>Assessment</h2>
     <p>The only deliverables for this project are two pseudocode functions.</p>
     
     <h3>Turning it in</h3>
     <ul>
       <li><b>Online</b>: Online students are to turn this in through I-Learn using Assignment Submission.
        This should be a single document submission.</li>
       <li><b>Campus</b>: Campus face-to-face students are to turn in a hard copy.
        Please use the Assignment Submission specified by your teacher.</li>
     </ul>
     
      <p>You are required to attach the 
        <a href="https://content.byui.edu/file/cddfb9c0-a825-4cfe-9858-28d5b4c218fe/1/Ponder/124.06.Project.Rubric.pdf">above rubric</a>
        to your design document.
        If you are a face-to-face student, please print out the rubric and staple it to your project.
        If you are an online student, please copy the above table and past it to the last page of your document.
        Please self-grade.</p>

     <h3>Grading</h3>
         <p>The grading criteria are:</p>

      <table class="rubric">
            <tbody>
          <tr>
            <th> </th>
            <th>Exceptional<br>100%</th>
            <th>Good<br>90%</th>
            <th>Acceptable<br>70%</th>
            <th>Developing<br>50%</th>
            <th>Missing<br>0%</th>
          </tr>
          <tr>
             <th><code>computeOffset()</code>: numDays<br>30%</th> 
<!-- 100 --> <td>Correctly count the number of days since the 1<sup>st</sup> of January, 1753</td> 
<!-- 90  --> <td>Counts the number of days since 1/1/1753 with a minor bug</td> 
<!-- 70  --> <td>A serious bug exists in counting the days since 1/1/1753 </td>
<!-- 50  --> <td>Insufficient detail to tell if the design will work</td> 
<!-- 0   --> <td>No pseudocode to count the number of days since 1/1/1753</td> 
          </tr>
          <tr>
             <th><code>computeOffset()</code>: offset<br>10%</th> 
<!-- 100 --> <td>The best way was found to compute the offset from numDays </td> 
<!-- 90  --> <td>Offset is correctly computed from numDays, but is inefficient </td> 
<!-- 70  --> <td>The approach will not work</td>
<!-- 50  --> <td>Insufficient detail to tell if the design will work</td> 
<!-- 0   --> <td>No pseudocode to compute the offset from numDays</td> 
          </tr>
          <tr>
             <th><code>displayTable()</code>: start of month<br>30%</th> 
<!-- 100 --> <td>Indents are correctly put in for the offset</td> 
<!-- 90  --> <td>One minor bug exists finding the 1st of the month</td> 
<!-- 70  --> <td>A bug exists in the algorithm</td>
<!-- 50  --> <td>Insufficient detail to tell if the design will work</td> 
<!-- 0   --> <td>No pseudocode to find the start of the month</td> 
          </tr>
          <tr>
             <th><code>displayTable()</code>: end of the week<br>30%</th> 
<!-- 100 --> <td>Newlines are correctly put in after each Saturday</td> 
<!-- 90  --> <td>One minor bug in identifying the end of the week</td> 
<!-- 70  --> <td>The approach will not work</td>
<!-- 50  --> <td>Insufficient detail to tell if the design will work</td> 
<!-- 0   --> <td>No pseudocode to find the end of the week</td> 
          </tr>
        </tbody>
      </table>
       
    <br>
    <iframe src="./Project 06 _ Calendar_files/SV_1RY6MGuNhQM3AjP.html" height="500px" width="100%"></iframe>

    </article> 
   </div> <!-- id="main" -->
 

<iframe src="./Project 06 _ Calendar_files/save-product.html" id="save-frame" style="top: 0px; right: 0px; display: none; width: 65px; height: 45px; z-index: 2147483647; border-style: none; overflow: visible; clip: initial; opacity: initial; position: fixed !important;"></iframe><iframe src="./Project 06 _ Calendar_files/index.html" id="save-item-frame" scrolling="no" style="width: 55px; top: 0px; right: 0px; display: none; z-index: 2147483647; border-style: none; overflow: hidden; clip: initial; position: fixed !important; height: 50px;"></iframe></body></html>