Skip to content

Instantly share code, notes, and snippets.

View AdamSheaffer's full-sized avatar

Adam Sheaffer AdamSheaffer

View GitHub Profile
USE MASTER
GO
IF NOT EXISTS (
SELECT [name]
FROM sys.databases
WHERE [name] = N'StudentExercises'
)
CREATE DATABASE StudentExercises
GO

Make a console application that creates a random number between 1 and 10 and gives the user 3 tries to correctly guess the number

RULES

  • The application should prompt the user to guess a number
  • If the number is correct, the application should print a success message and exit the program
  • If the number is not correct, the program should give them two more guesses
  • If the number is not correctly guessed after 3 tries, a message should be printed to the screen and the program should exit.

C# Setup

  1. Go through this Hello World walkthrough to install the .NET Core SDK
  2. Install the C# VSCode extension. (It's the one whose icon looks like a ninja turtle)
  3. Install the C# FixFormat extension for VSCode
  4. Go into your User Settings in VSCode (CMD + , on Mac and Ctrl + , on Windows) and check the following settings:
  • Format On Save is checked
  • Auto Save is set to either off, onFocusChange, or onWindowChange (FWIW, I like focusChange)

You've written a script and are producing an independant film about software engineers. It's going to quickly become an expensive venture so it'd be good idea to start managing your budget now. And since the movie is about hackers, it's probably best that your budgeting tool be run from the terminal.

Most of the little things in the budget have already been handled. The only things that'll you'll have to manage are the cast, crew, and locations. You'll start with an existing codebase, and some of the cast and crew that have already signed on have already come preloaded into the program. Any additional ones will have to be entered by the users of the budgeting tool. The inital budget stands at $1M, but if you're running low on funding, you can bring on additional executive producers who are willing to financially contribute to the project.

Tickets

  • When app starts, the following information should be displayed:

    • [Name of the movie]
  • Starring: [top 2 paid cast members]

Bangazon API

The front end team has been given a prototype API to help them implement their React application. The prototype is built similar to JSON Server and not a actual long-term solution for persisting and retrieving data. It's now your team's job to build a production ready API to replace the prototype.

If you complete all tickets in your backlog, you should have the following endpoints implemented.

Your front end developers are expecting data back from your API that looks exactly like what's listed below. If certain properties don't match, the client application will break. NOTE Don't worry about any differences in dummy data the prototype uses vs the data in your database. The only thing that is important is that the shape of each resource should match exactly.

To see examples from the prototype API you can use this base URL:

Heist Part II

  • Knocking over banks isn't going to be easy. Alarms... Vaults... Security Guards.... Each of these safeguards is something we'll have to handle for a successful heist. First things first. Let's create a Bank class to represent the security we're up against. Give the Bank class the following properties:

    • An integer property for CashOnHand
    • An integer property for AlarmScore
    • An integer property for VaultScore
    • An integer property for SecurityGuardScore
    • A computed boolean property called IsSecure. If all the scores are less than or equal to 0, this should be false. If any of the scores are above 0, this should be true
  • Each type of robber will have a special skill that will come in handy while knocking over banks. Start by creating an interface called IRobber. The interface should include:

// An issue you may run into when dealing with fetch calls to your firebase realtime database is that the data is likely not in the structure you want it. The data will come back in the form of an object with each item's ID is the key.
// Example response
{
"-lk38hfnb": {
title: "My Title 1",
description: "My Description 1"
},
"-fn947bfh": {
@AdamSheaffer
AdamSheaffer / Composition.md
Last active July 15, 2019 02:34
Intro to C# interfaces and the merits of composition over inheritance

Classy Electronics

You've just started working for a boutique electronic company and you've been tasked with modeling their new line of record players.

Step 1:

The company's most basic product line is simple turntables that can support rpm speeds of 33, 45, and 78 Create a TurnTable class with these properties and methods:

Properties

###Rule 1 Collaboration is required

###Rule 2 Project features must be clearly communicated

###Rule 3 3rd party library must be approved by instructor or TA's

###Rule 4

https://www.stubhub.com/listingCatalog/select?q=stubhubDocumentType:event%20AND%20venue_name:"Citizens%20Bank%20Park"%20AND%20ancestorGenreDescriptions:MLB&start=0&rows=50&indent=on&wt=json