Skip to content

allegheny-computer-science-100-01-f2019/lab07-starter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cs100f2019-lab07-starter

Designed for use with GitHub Classroom, this repository contains the solution for Laboratory 7 in Computer Science 100.

Since the Travis builds for this repository will initially fail (as evidenced by a red ✗ appearing in the commit logs instead of a green ✔), the programmer is responsible for completing all of the steps needed to satisfy the requirements for the assignment, thus causing a ✔ to instead appear in the commit logs.

Introduction

This assignment requires programmers to implement and test an bank ATM system. First, the program will display a welcome message and read the user's card information from the text file. Then, it will read in user's preferred actions and, finally, produce output that meets the requirements outlined later in the assignment. As verified by Checkstyle, the source programs must adhere to all of the requirements in the Google Java Style Guide.

The programmers are also responsible for writing a three-paragraph reflection, stored in the file writing/reflection.md, that explains the challenges that they faced and the solutions they developed and their strategy for testing their solution. This is a Markdown file that must adhere to the standards described in the Markdown Syntax Guide. Remember, you can preview the contents of a committed Markdown file by clicking on the name of the file in your GitHub repository.

The source code of the two Java file must also pass additional tests set by the GatorGrader tool. As before, GatorGrader will check to ensure that one of the Java files uses the new Date() construct in the Java code. Moreover, GatorGrader will check the following characteristics of your implementation:

  • The Atm program must:

    • Contain at least five single-line comments and two multi-line comments
    • Use at least two if and else statements
    • Contain at least ten println statements to display output
    • Call methods of the other provided class
  • The Account program must:

    • Contain at least five multi-line comments
    • Not include any println statements
    • Include a constructor as specified by the UML diagram in the assignment sheet
    • Include withdraw, deposit and getBalance methods as outlined in the assignment sheet
  • The Offer program must:

    • Contain at least five multi-line comments
    • Not include any println statements
    • Include a constructor as specified by the UML diagram in the assignment sheet
    • Include setOffer, getOfferText and getOfferId methods as outlined in the assignment sheet

When you use the git commit command to transfer your source code to your GitHub repository, Travis CI will initialize a build of your assignment, checking to see if it meets all of the requirements. If both your source code and writing meet all of the established requirements, then you will see a green ✔ in the listing of commits in GitHub. If your submission does not meet the requirements, a red ✗ will appear instead. The instructor will reduce a programmer's grade for this assignment if the red ✗ appears on the last commit in GitHub immediately before the assignment's due date.

A carefully formatted assignment sheet for this project provides more details about the steps that a computer scientist should take to complete this assignment. You can view this assignment sheet by visiting the listing of laboratories on the course web site.

Learning

If you have not done so already, please read all of the relevant GitHub Guides that explain how to use many of the features that GitHub provides.

To do well on this assignment, you should also review Chapters 1 through 3 and study Sections 4.1 through 4.5. To enhance your understanding of some points in this laboratory assignment, you should also review the class exercise. Please see the course instructor or one of the teaching assistants or tutors if you have questions about any of these reading assignments.

System Commands

This project invites students to enter system commands into a terminal window. This assignment uses Docker to deliver programs, such as gradle and the source code and packages needed to run GatorGrader, to a students' computer, thereby eliminating the need for a programmer to install them on their development workstation. Individuals who do not want or can not install Docker can optionally install of the programs mentioned in the Project Requirements section of this document. Once all the required programs are installed locally on a machine, a software developer can type the various gradle commands directly in the terminal.

Using Docker

Once you have installed Docker Desktop, you can use the following docker run command to start gradle grade as a containerized application, using the DockaGator Docker image available on DockerHub.

docker run --rm --name dockagator \
  -v "$(pwd)":/project \
  -v "$HOME/.dockagator":/root/.local/share \
  gatoreducator/dockagator

The aforementioned command will use "$(pwd)" (i.e., the current directory) as the project directory and "$HOME/.dockagator" as the cached GatorGrader directory. Please note that both of these directories must exist, although only the project directory must contain something. Generally, the project directory should contain the source code and technical writing of this assignment, as provided to a student through GitHub. Additionally, the cache directory should not contain anything other than directories and programs created by DockaGator, thus ensuring that they are not otherwise overwritten during the completion of the assignment. To ensure that the previous command will work correctly, you should create the cache directory by running the command mkdir $HOME/.dockagator. If the above docker run command does not work correctly on the Windows operating system, you may need to instead run the following command to work around limitations in the terminal window:

docker run --rm --name dockagator \
  -v "$(pwd):/project" \
  -v "$HOME/.dockagator:/root/.local/share" \
  gatoreducator/dockagator

Since the above docker run command uses a Docker images that, by default, runs gradle grade and then exits the Docker container, you may want to instead run the following command so that you enter an "interactive terminal" that will allow you to repeatedly run commands within the Docker container.

docker run -it --rm --name dockagator \
  -v "$(pwd)":/project \
  -v "$HOME/.dockagator":/root/.local/share \
  gatoreducator/dockagator /bin/bash

Once you have typed this command, you can use the GatorGrader tool in the Docker container by typing the command gradle grade in your terminal. Running this command will produce a lot of output that you should carefully inspect. If GatorGrader's output shows that there are no mistakes in the assignment, then your source code and writing are passing all of the automated baseline checks. However, if the output indicates that there are mistakes, then you will need to understand what they are and then try to fix them.

Here are some additional commands that you may need to run when using Docker:

  • docker info: display information about how Docker runs on your workstation
  • docker images: show the Docker images installed on your workstation
  • docker container list: list the active images running on your workstation
  • docker system prune: remove many types of "dangling" components from your workstation
  • docker image prune: remove all "dangling" docker images from your workstation
  • docker container prune: remove all stopped docker containers from your workstation
  • docker rmi $(docker images -q) --force: remove all docker images from your workstation

Using Gradle

You can complete several important Java programming tasks by using the gradle tool. For instance, you can compile (i.e., create bytecode from the program's source code if it is correct) the program using the command gradle build. Running the command gradle -q --console plain run will suppress the display of Gradle's diagnostic information and only produce output of the program. Here are some other commands that you can type:

  • gradle grade: run the GatorGrader tool to check your work
  • gradle clean: clean the project of all the derived files
  • gradle check: check the quality of the code using Checkstyle
  • gradle build: create the bytecode from the Java source code
  • gradle run: run the Java program in the command-line
  • gradle -q --console plain run*: run the Java program without Gradle's extraneous information
  • gradle tasks: display details about the Gradle system

To run one of these commands, you must be in the main (i.e., "home base") directory for this assignment where the build.gradle file is located.

Expected Program Output

Due to the different input values passed to this program, typing the command gradle run in the terminal window produces textual output that will differ from the instructor's version shown below. Your program must adhere to all of the requirements for the assignment and pass all of the verification checks, producing textual output that follows the pattern that is given on the assignment sheet.

> Task :run
Welcome to JJ ATM!

Finding your account information.

Linking to your checking account details.

First, let's check your balance
Your current balance is $1000.0
Okay, you would like to withdraw $100
Your updated balance is $900.0
Offer id 123: Get $10 back when you spend $3000 in 30 days. Offer valid until 11/31/2018.

Thank you for using JJ ATM!

Reporting Problems

If you have found a problem with this assignment's provided source code, then you can go to the Computer Science 100 Lab 07 Starter repository and create an issue by clicking the "Issues" tab and then clicking the green "New Issue" button. If you have found a problem with the GatorGrader tool and the way that it checks you assignment, then you can follow the aforementioned steps to create an issue in its repository. To ensure that your issue is properly resolved, please provide as many details as is possible about the problem that you experienced.

Students who find, and use the appropriate GitHub issue tracker to correctly document, a mistake in any aspect of this laboratory assignment will receive extra credit towards their grade for it.

Receiving Assistance

If you are having trouble completing any part of this project, then please talk with either the course instructor or a teaching assistant during the laboratory session. Alternatively, you may ask questions in the Slack team for this course. Finally, you can schedule a meeting during the course instructor's office hours.

Project Assessment

The grade that a student receives through Sakai on this assignment will have the following components:

  • Percentage of Correct GatorGrader Checks [up to 75%]: Students are encouraged to repeatedly try to implement a Java program that passes all of GatorGrader's checks by, for instance, creating a program that produces the correct output. Students should also repeatedly revise their technical writing to ensure that it also passes all of GatorGrader's checks about, for instance, the length of its content and its appropriate use of Markdown.

  • Travis CI Build Status [5%]: Since additional checks on the source code and/or technical writing may be encoded in Travis CI's actions and, moreover, all of the GatorGrader checks are also run in Travis CI, a portion of the students' lab grade depends on whether their last before-the-deadline build passes and a green ✔ appears in their GitHub commit log instead of a red ✗. As with the previous grading component, students are encouraged to repeatedly revise their source code and technical writing in an attempt to get their Travis CI build to pass.

  • Mastery of Technical Writing [up to 10%]: Students will also receive this portion of the lab grade when the responses to the technical writing questions presented in the writing/reflection.md reveal a mastery of both writing skills and technical knowledge. To receive this portion of the grade, the submitted writing should have correct spelling, grammar, and punctuation in addition to following the rules of Markdown and providing technically accurate answers. Students are encouraged to ask the course instructor or a student technical leader to use the GitHub issue tracker to provide feedback on their mastery of technical writing skills.

  • Mastery of Technical Knowledge and Skills [up to 10%]: Students will receive a portion of their assignment grade when their GitHub repository reveals that they have mastered all of the technical knowledge and skills developed during the completion of this project. As a part of this grade, the instructor will assess aspects of the project including, but not limited to, the use of effective source code comments and Git commit messages. Students are encouraged to ask the course instructor or a student technical leader to use the GitHub issue tracker to provide feedback on how well their work demonstrates mastery of the assignment's technical knowledge and skills.

About

Starter files for lab 07 in CMPSC 100-01 Fall 2019

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages