User Tools

Site Tools


Sidebar

projects

wcp1 (due 20240124)
pct0 (bonus; due 20240125)
pct1 (bonus; due 20240125)
abc0 (due 20240131)
pct2 (due 20240131)
wcp2 (due 20240131)
gtf0 (due 20240207)
pct3 (bonus; due 20240207)
wcp3 (due 20240207)
dtr0 (due 20240214)
pct4 (due 20240214)
wcp4 (due 20240214)
bwp1 (bonus; due 20240228)
mmf0 (due 20240228)
pct5 (bonus; due 20240228)
wcp5 (due 20240228)
cnv0 (due 20240306)
gfo0 (due 20240306)
pct6 (due 20240306)
wcp6 (due 20240306)
cnv1 (due 20240313)
fwg0 (due 20240313)
pct7 (bonus; due 20240313)
wcp7 (due 20240313)
fwg1 (due 20240320)
pct8 (due 20240320)
wcp8 (due 20240320)
pct9 (bonus; due 20240327)
wcp9 (due 20240327)
bwp2 (bonus; due 20240410)
fwg2 (due 20240410)
fwg3 (due 20240410)
gfo1 (due 20240410)
pctA (due 20240410)
wcpA (due 20240410)
cpp0 (due 20240417)
pctB (bonus; due 20240417)
wcpB (due 20240417)
cpp1 (due 20240424)
pctC (due 20240424)
wcpC (due 20240424)
pctD (bonus; due 20240501)
wcpD (bonus; due 20240501)
gfo2 (due 20240508)
pctE (bonus; due 20240508)
wcpE (bonus; due 20240508)
EoCE (due 20240516)
haas:spring2024:cprog:projects:mmf0

Corning Community College

CSCS1320 C/C++ Programming

PROJECT: Mental Math Fun (MMF0)

OBJECTIVE

To explore relational decision making, as applied to a mental math process.

GRABIT

To assist with consistency across all implementations, data files for use with this project are available on lab46 via the grabit tool. Be sure to obtain it and ensure your implementation properly works with the provided data.

lab46:~/src/SEMESTER/DESIG$ grabit DESIG PROJECT

Please study any provided code, comments, or supporting documents, and look up, experiment, and ask questions on aspects that you do not understand.

EDIT

You will want to go here to edit and fill in the various sections of the document:

MMF0

Process

Input value as short int (all four digits)
Obtain the last two digits of this input value

-In order to obtain the last two digits of this input value, you can create a new variable and set that to be the result of the input year variable, divided by the integer division remainder (%) followed by 100. This is because a four-digit number, divided by 100 will yield a remainder in the tenth's and / or hundredth's place. This decimal-place number will be what you are looking to use for the next steps in the project.

-For example: short unsigned int new = year % 100

Quarter the value

subtract 2000 from the given year, and then divide by 4 using the “/” sign.

NOTE: Use () to ensure the code does things in the order you want.

Add quartered value back to two digit year

Add quartered value (output of last sections equation) to the last two digits of the current year (output of first section).

Subtract best fitting multiple of seven
Look up day in table
Day Value
Monday 1
Day Value
Tuesday 2
Day Value
Wednesday 3
Day Value
Thursday 4
Day Value
Friday 5
Day Value
Saturday 6
Day Value
Sunday 7
Day Value
Sunday 0
Edge case: leap years

To find the edge case you have to check if there is a remainder when dividing the year by 4

SELECTION

if statements

if statements are written as “if (condition){ the thing you want to happen }

If the condition is not met, “the thing you want to happen” is skipped over.

else if

ELSE IF is put at the end of a IF statement. ELSE IF will first check if the condition of the original IF statement was met, if it wasn't met, It then prompts another IF statement

Example:

if (condition0) 
{
     If condition0 is met do this ....
} 
else if (condition1) 
{
     if condition0 isn't met and condition1 is; Do this ....    
}
else

ELSE is put at the end of a IF statement. ELSE will first check if the condition of the original IF statement was met, if it wasn't met, It then does something

Example:

if (condition0) 
{
     If condition0 is met do this ....
} 
else  
{
     if condition0 isn't met do this ....    
}
RELATIONAL OPERATORS
Operator Description
== is equal to
!= is not equal to
< greater than
> less than
< = less than or equal to
> = greater than or equal to

VERIFY RESULTS

To verify your results, ./mmf0verify

Remember to only use stdout to print the days of the week [EX: fprintf(stdout, “Monday\n”)]. If stdout is used for anything other than the days of the week, the mmf0verify will say you have a mismatch for every year, even if you get the correct day when you run your compiled code. If you want to print something other than the days of the week, use stderr.

 

SUBMISSION

To be successful in this project, the following criteria (or their equivalent) must be met:

  • Project must be submit on time, by the deadline.
    • Late submissions will lose 33% credit per day, with the submission window closing on the 3rd day following the deadline.
  • All code must compile cleanly (no warnings or errors)
    • Compile with the -Wall and --std=gnu18 compiler flags
    • all requested functionality must conform to stated requirements (either on this document or in a comment banner in source code files themselves).
  • Executed programs must display in a manner similar to provided output
    • output formatted, where applicable, must match that of project requirements
  • Processing must be correct based on input given and output requested
  • Output, if applicable, must be correct based on values input
  • Code must be nicely and consistently indented
  • Code must be consistently written, to strive for readability from having a consistent style throughout
  • Code must be commented
    • Any “to be implemented” comments MUST be removed
      • these “to be implemented” comments, if still present at evaluation time, will result in points being deducted.
      • Sufficient comments explaining the point of provided logic MUST be present
  • No global variables (without instructor approval), no goto statements, no calling of main()!
  • Track/version the source code in your lab46 semester repository
  • Submit a copy of your source code to me using the submit tool (make submit on lab46 will do this) by the deadline.

Submit Tool Usage

Let's say you have completed work on the project, and are ready to submit, you would do the following:

lab46:~/src/SEMESTER/DESIG/PROJECT$ make submit

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.

RUBRIC

I'll be evaluating the project based on the following criteria:

39:mmf0:final tally of results (39/39)
*:mmf0:used grabit for project by Sunday prior to duedate [8/8]
*:mmf0:clean compile, no compiler messages [8/8]
*:mmf0:program performs mental math process [8/8]
*:mmf0:program output conforms to specifications [8/8]
*:mmf0:code tracked in lab46 semester repo [7/7]

Pertaining to the collaborative authoring of project documentation

  • each class member is to participate in the contribution of relevant information and formatting of the documentation
    • minimal member contributions consist of:
      • near the class average edits (a value of at least four productive edits)
      • near the average class content change average (a value of at least 256 bytes (absolute value of data content change))
      • near the class total content contribution average (a value of at least 1kiB)
      • no zero-sum commits: no adding in one commit then later removing in its entirety for the sake of satisfying edit requirements
    • adding and formatting data in an organized fashion, aiming to create an informative and readable document that anyone in the class can reference
    • content contributions will be factored into a documentation coefficient, a value multiplied against your actual project submission to influence the end result:
      • no contributions, co-efficient is 0.50
      • less than minimum contributions is 0.75
      • met minimum contribution threshold is 1.00

Additionally

  • Solutions not abiding by spirit of project will be subject to a 50% overall deduction
  • Solutions not utilizing descriptive why and how comments will be subject to a 25% overall deduction
  • Solutions not utilizing indentation to promote scope and clarity or otherwise maintaining consistency in code style and presentation will be subject to a 25% overall deduction
  • Solutions not organized and easy to read (assume a terminal at least 90 characters wide, 40 characters tall) are subject to a 25% overall deduction
haas/spring2024/cprog/projects/mmf0.txt · Last modified: 2024/02/26 21:42 by 127.0.0.1