User Tools

Site Tools


haas:fall2023:c4eng:projects:abc0

Corning Community College

ENGR1050 C for Engineers

PROJECT: Already Beginning Concepts (ABC0)

OBJECTIVE

To get started on the course and semester. Bootstrap your access and configuration of various resources, following instructions, contributing to documentation, and asking questions in the discord.

EDIT

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

ABC0 documentation

Tasks

Get on discord and into class channels

Join the Discord, the invite can be found towards the top of the syllabus located here. You may create a new account or join with an existing one. Once you've joined, introduce yourself with your name, and what classes you're taking so that appropriate roles can be assigned, granting you access to the class channels.

Log into Lab46 (shell)

Instructions on how to log into Lab46 via shell can be found here.

Clone lab46 semester repo on lab46

After you've logged into lab46 via shell, we'll be using Mercurial to clone a remote repository.

You can accomplish this by running fixrepo at the lab46 prompt:

lab46:~$ fixrepo

and follow and instructions, respond to any actions requested.

Should you wish to do things more manually, do the following:

This is done with the command:

 hg clone ssh://cgaffne1@lab46.g7n.org//var/repos/hg/user/cgaffne1 ~/src 

Where uppercase USER is replaced with your lab46 username, and lowercase user remains unchanged.

This will clone the repository into a directory named src that is a subdirectory of your home (~) directory.

We will also be cloning a second repository for the semester, done with the command:

 hg clone ssh://cgaffne1@lab46.g7n.org//var/repos/hg/user/cgaffne1/fall2023 ~/src/fall2023

Where SEMESTER is your semester written as the name of the month in lowercase and then the year in YYYY format, without spaces, e.g. fall2023.

Log into Lab46 wiki

At the top right of any lab46.g7n.org page should be a button to log in, shown here:

The username and password should be the same as the username and password you used to log into Lab46 via shell in previous steps.

Set up personal development system

Your personal development system will be the Raspberry Pi 4, a link to which will be in the class syllabus, in the “Referenced Books” section. Instructions on how to set up should be included in the purchased kit.

Clone lab46 semester repo on your system

The steps here are very similar to the steps in the section “Clone lab46 semester repo on lab46”; however, assuming your development system has just been set up with Raspberry Pi OS, then Mercurial is not yet installed. Luckily, this is easy on most UNIX-like operating systems. Simply open your terminal, which should be located at the top of the desktop, and type hg. Once you enter that command, you should be prompted to install Mercurial. Once Mercurial is installed, you may proceed. You should start by creating a directory anywhere you'd like, using the mkdir command, i.e.

 mkdir NAME 

Where NAME is the name you'd like to give the directory. do not freak out when the terminal spits back nothing. the directory is created, and you should be able to see it by typing “ls”.

After making this organizational directory, we will now clone the repo. To do so, we'll use Mercurial's hg clone command again, into a new src directory under our directory, like so:

hg clone ssh://cgaffne1@lab46.g7n.org//var/repos/hg/user/cgaffne1 /NAME/src 

Where NAME is the name you gave the directory, and you are currently in its parent directory.

Once that is done, we'll clone the semester repo:

hg clone ssh://cgaffne1@lab46.g7n.org//var/repos/hg/user/cgaffne1/SEMESTER /NAME/src/SEMESTER

Recall that SEMESTER is the lowercase name of the month and the year in YYYY format, without spaces. e.g. fall2023

Let's enter the SEMESTER directory using cd, as such:

cd /NAME/src/SEMESTER

From here we'll create a class directory with the name of the class, e.g. c4eng, and a subdirectory of it for our project abc0:

mkdir -p c4eng/abc0

This is where we'll put our project files coming up in the next steps.

Create info.text file with information

Assuming we are currently in the SEMESTER directory, we can enter the abc0 project directory using

cd c4eng/abc0

To create and edit info.text, we can use the nano text editor via the terminal:

nano info.text

This creates the file info.text and starts editing it. You can see all the commands at the bottom of the terminal, with ^ signifying that you must hold the CTRL key while pressing the respective letter. Now you can populate info.text with some information such as your preferred name, your program (e.g. Engineering Science), your preferred contact email, discord username, and any additional information you may want to supply to the professor.

When you are finished editing the file, use the “Write Out” command and chose a format. Press enter to send the command. Then “Exit” the file. Note, the ^ symbol correspond to the CRTL key and the M corresponds to the ALT key.

If you wish to view this information, you can use the cat command:

cat info.text

This displays the content of the file on the terminal. It is most useful when you wish to view text files.

Create and execute hello.c

Assuming we are still inside abc0, the next steps are writing a “Hello World” program in C, compiling, and then executing it. A “Hello World” program is a beginner program that demonstrates how to structure our code, invoke our code, and print some output, namely “Hello World”, to the terminal. Let's start editing hello.c by typing

nano hello.c

Now that we have a file named hello.c and we are now editing it, we can write the following code:

#include <stdio.h> 

int main(void)
{
	printf("Hello World\n"); 
	return 0; 
}

Later we'll go into more depth on what the surrounding lines of code do, but for now we should know that printf(“”); prints text within the quotes to the screen.

Now we want to compile this code into instructions that the computer can understand. We can do that simply using the GCC compiler:

gcc hello.c -Wall -std=gnu18 -o hello

This will give us our executable as a file named hello, which we can now run by typing

./hello

If everything has worked correctly, you should see “Hello World” printed to the terminal.

Locate journal and customize title and intro
 

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 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$ submit DESIG PROJECT file1 file2 file3 ... fileN

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:

13:abc0:final tally of results (13/13)
*:abc0:submitted information for project by duedate [3/3]
*:abc0:got situated in and used class discord [3/3]
*:abc0:contributed to project documentation [3/3]
*:abc0:committed project related changes to semester repo [4/4]

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 128 bytes (absolute value of data content change))
      • near the class content contribution average (a value of at least 1kiB)
      • no zero-sum commits (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/fall2023/c4eng/projects/abc0.txt · Last modified: 2023/08/20 14:39 by wedge