User Tools

Site Tools


Sidebar

projects

ntr0 (due 20220119)
pct1 (bonus; due 20220119)
wcp1 (due 20220119)
adm0 (due 20220126)
pct2 (due 20220126)
wcp2 (due 20220126)
pbx0 (due 20220202)
pct3 (bonus; due 20220202)
wcp3 (due 20220202)
pbx1 (due 20220209)
pct4 (due 20220209)
wcp4 (due 20220209)
gfo0 (due 20220216)
pbx2 (due 20220216)
pct5 (bonus; due 20220216)
wcp5 (due 20220216)
bwp1 (bonus; due 20220302)
pct6 (due 20220302)
usr0 (due 20220302)
wcp6 (due 20220302)
pct7 (bonus; due 20220309)
upf0 (due 20220309)
wcp7 (due 20220309)
pct8 (due 20220316)
upf1 (due 20220316)
wcp8 (due 20220316)
gfo1 (due 20220323)
mtf0 (due 20220323)
pct9 (bonus; due 20220323)
wcp9 (due 20220323)
bwp2 (bonus; due 20220406)
pctA (due 20220406)
wcpA (due 20220406)
wpa0 (due 20220406)
pctB (bonus; due 20220413)
pwn0 (due 20220413)
wcpB (due 20220413)
ldg0 (due 20220420)
pctC (due 20220420)
wcpC (due 20220420)
gfo2 (due 20220427)
pctD (bonus; due 20220427)
wcpD (bonus; due 20220427)
pctE (bonus; due 20220504)
wcpE (bonus; due 20220504)
EoCE (due 20220512)
haas:spring2022:unix:projects:ldg0

Corning Community College

CSCS1730 UNIX/Linux Fundamentals

Project: LETTER DIVISION GENERATOR (ldg0)

Objective

Write a wrapper script around a long division generator in order to create a functional letter division generator in the pctX style.

Abstraction

As an exercise in toning your abstraction abilities (literally seeing one thing, but understanding and using it as something else), there will be a number of 'generic' terms used throughout this (and other) documents throughout the course, requiring you to substitute in the pertinent information (else face confusion or error).

Some examples:

  • yourusername - where you see this (likely in a config file or command-line argument), you are NOT to literally type in y-o-u-r-u-s-e-r-n-a-m-e, but instead, substitute in YOUR lab46 username.
  • desig - different classes have different class designations. To make one universal document pertinent to ALL classes, specific examples will instead use 'desig', where you must substitute in the class desig of the class YOU are taking and acting upon in that moment. Example class desigs:
    • c4eng - ENGR1050 “C for Engineers”
    • cprog - CSCS1320 “C/C++ Programming”
    • unix - CSCS1730 “UNIX/Linux Fundamentals”
    • data - CSCS2320 “Data Structures”
    • discrete - CSCS2330 “Discrete Structures”
    • comporg - CSCS2650 “Computer Organization”
    • sysprog - CSCS2730 “Systems Programming”

This sort of abstraction is very similar to that we will find in our utilization of variables in programming, where we can have a “name”, but the data associated with it can change based on various conditions.

Do not be a literalist computer! Start to exercise your abstraction abilities.

2021/01/25 11:37

Locational Awareness

This document is written with TWO locations in mind:

  • lab46 (the system you may retrieve resources and SUBMIT projects)
    • identified in examples with the use of the lab46:~$ prompt
  • your pi (the system you will transfer resources to/from, and WORK ON/COMPLETE projects)
    • identified in examples with the use of the yourpi:~$ prompt

There are commands you can ONLY run on one system or the other. Pay attention to any prompt cues in the given examples (or section headings, context of language leading up to any examples).

For example:

  • YOU cannot install software on lab46. You don't have access.
  • projects CANNOT be SUBMITTED on your pi.

Please pay attention to your prompt, so you can perform the needed activity on the correct system.

2021/01/25 11:37

Reading

Please be sure to familiarize yourself with the pertinent content in:

Please familiarize yourself with the table of contents and or index of the various resources, and sample various content to connect yourself with deeper understanding into the concepts being called upon in the current activity.

On your pi

Develop and test this program on your pi. Only when done, verify that it compiles on lab46.

To utilize the needed functionality for this project, you will need to ensure you have the following packages installed:

  • mercurial (also installed and configured in ntr0)

NOTE: make sure you, for the purposes of your activities pertaining to this class, that you are using your SEMESTER repository.

Specifications

Your program should:

  • have valid, descriptive variable names of length no shorter than 4 symbols
  • perform any needed checks to make sure needed things exist and are valid before proceeding
  • have consistent, well-defined indentation (no less than 4 spaces per level of indentation)
    • all code within the same scope aligned to its indentation level
  • have proximal comments explaining your rationale and what is going on, throughout your code
  • perform the intended operation, outputting the correct/accurate information in indicated format
  • at the end of your main() function, use a single return statement to conclude your code, return a 0 indicating successful operation

Grabbing project resources

To obtain project data, you will need to satisfy the following prerequisites:

  • be logged into lab46 (shell) as your user
  • have your semester lab46 repo cloned (into ~/src/SEMESTER)
  • have created the appropriate DESIG (like “cprog” or “unix”) subdirectory therein (~/src/SEMESTER/DESIG)
  • have changed into that ~/src/SEMESTER/DESIG directory

If all those conditions are met, you can use the grabit tool to obtain the project, as follows:

lab46:~/src/SEMESTER/DESIG$ grabit DESIG ldg0
make: Entering directory '/var/public/SEMESTER/DESIG/ldg0'
'/var/public/SEMESTER/DESIG/ldg0/Makefile' -> '/home/USER/src/SEMESTER/DESIG/ldg0/Makefile'
'/var/public/SEMESTER/DESIG/ldg0/README' -> '/home/USER/src/SEMESTER/DESIG/ldg0/README'
'/var/public/SEMESTER/DESIG/ldg0/ldg0.sh' -> '/home/USER/src/SEMESTER/DESIG/ldg0/ldg0.sh'
'/var/public/SEMESTER/DESIG/ldg0/ref_ldg0.aarch64' -> '/home/USER/src/SEMESTER/DESIG/ldg0/ref_ldg0.aarch64'
'/var/public/SEMESTER/DESIG/ldg0/ref_ldg0.armv7l' -> '/home/USER/src/SEMESTER/DESIG/ldg0/ref_ldg0.armv7l'
'/var/public/SEMESTER/DESIG/ldg0/ref_ldg0.x86_64' -> '/home/USER/src/SEMESTER/DESIG/ldg0/ref_ldg0.x86_64'
make: Leaving directory '/var/public/SEMESTER/DESIG/ldg0'
lab46:~/src/SEMESTER/DESIG$ 

At which point you can change into the newly created and populated ldg0 directory.

Raspberry Pi command-line via SSH/MOSH

If you don't have a monitor, you likely are logging into your pi remotely (doable, and good intra-system practice)

Once your ldg0 project files are 'hg' added to your repository on lab46, commit and push.

On your pi, to obtain those files there, be sure to be in your repository, and 'hg' pull and update.

NOTE: To avoid repository conflicts, ALWAYS check for any incoming pull/update transactions before doing a commit/push. Problems occur when you forget (this is an issue on both lab46 and your pi).

Run your script:

lab46:~/src/SEMESTER/DESIG/ldg0$ ./ldg0.sh

Submission

To successfully complete this project, the following criteria must be met:

  • Code must compile cleanly (no notes, warnings, nor errors)
  • Output must be correct, and match the form given in the sample output above.
  • Code must be nicely and consistently indented
  • Code must be well commented
  • Do NOT double space your code. Group like statements together.
  • Output Formatting (including spacing) of program must conform to the provided output (see above).
  • Track/version the source code in a repository
  • Submit a copy of your source code to me using the submit tool.

To submit this program to me using the submit tool, run the following command at your lab46 prompt:

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

Project backup process commencing

Taking snapshot of current project (ldg0)      ... OK
Compressing snapshot of ldg0 project archive   ... OK
Setting secure permissions on ldg0 archive     ... OK

Project backup process complete

Submitting DESIG project "ldg0":
    -> ../ldg0-DATESTAMP-HOUR.tar.gz(OK)

SUCCESSFULLY SUBMITTED
lab46:~/src/SEMESTER/DESIG/ldg0$ 

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.

What I'll be looking for:

78:ldg0:final tally of results (78/78)
*:ldg0:obtained via grabit by Sunday before deadline [6/6]
*:ldg0:script contains no syntax errors [6/6]
*:ldg0:script contains no logical errors [6/6]
*:ldg0:script contains no runtime errors [6/6]
*:ldg0:script performs stated task/algorithm [6/6]
*:ldg0:script output conforms to formatting expectations [6/6]
*:ldg0:proper error checking and status reporting performed [6/6]
*:ldg0:code implements solution using relevant concepts [6/6]
*:ldg0:code updates committed/pushed to lab46 semester repo [6/6]
*:ldg0:code uses correct variable types and name lengths [6/6]
*:ldg0:project is submitted with relevant and complete source [6/6]
*:ldg0:project is submitted on lab46 using 'make submit' [6/6]
*:ldg0:runtime tests of submitted program succeed [6/6]

Additionally:

  • Solutions not abiding by SPIRIT of project will be subject to a 25% 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 will be subject to a 25% overall deduction
  • Solutions lacking ORGANIZATION ior are not easy to read (within 90 char width) are subject to a 25% overall deduction
haas/spring2022/unix/projects/ldg0.txt · Last modified: 2021/03/11 23:12 by 127.0.0.1