Skip to content

Instantly share code, notes, and snippets.

public class DistanceApprox{
public String name;
//public double inches;
public double feet;
public DistanceApprox(String name, double feet){
this.name = name;
//this.inches = inches;
this.feet = feet;
}
public class Distance{
public double bigTriangleWidth;
public double bigTriangleLength;
public double bigTriangleAngle;
public double robbersXCoordinate;
public double robbersYCoordinate;
/*
* Constructor sets the robber's X and Y coordinates from input.
* @ param - input representing the robbers X and Y coordinates.
import java.util.Scanner;
public class DistanceCalculations {
public static void main(String[] args){
Scanner input = new Scanner(System.in);
double bigTriangleWidth;
double bigTriangleHeight;
double bigTriangleAngle;
double bigTriangleHypotenus;
double smallTriangleHypotenus;
double smallTriangleWidth;
/** For this assignment you will write an assembly language function (in 32-bit
* mode) to manipulate a 2-dimensional array that represents an image. The image
* is a bitmapped image, where (at least for the images we will be working with)
* each pixel is represented by 3 bytes that indicate how much red, green, and
* blue there is at that location.
* @author: Diego Diaz
* Course: COMP B13
* Created on: Dec 4, 2015
* Source File: twoDprocessFloat.s
*/
@asterwolf
asterwolf / FizzBuzz.java
Created November 22, 2015 23:27
A program that counts from 1 to 100, printing "Fizz" if the number is divisible by 3, prints "Buzz" if it's divisible by 5, and prints "FizzBuzz" if it's divisible of both 3 and 5.
public class FizzBuzz{
public static void main(String[] args){
for(int i = 1; i <= 100; i++){
/*
* Could check to see if i is divisible by 5 and 3 first
* that way you won't have to check if it's divisible by 3
* and not also divisible by 5 and vice versa.
if(i % 3 == 0 && i % 5 != 0){
int findMatchingChars(char *string1, char *string2, char *outString);
#include <stdio.h>
int main(int argc, char**argv){
char outString[30];
int count;
if(argc <= 2){
printf("Usage: matchCharsMain string1 string2");
}
else{
count = findMatchingChars(argv[1], argv[2], outString);
#include <iostream>
#include <sstream>
using namespace std;
int main(int arc, char* argv[]){
string phrase;
string words[20];
cout << "Enter in a sentence to be translated into piglatin." << endl;
getline (cin, phrase);
/*
* Tester program
* @author: Diego Diaz
* Created on: Sept 06, 2015
* Source File: bottlesOfBeer.cpp
*/
#include <iostream>
#include <sstream>
using namespace std;
/*
* Tester program
* @author: Diego Diaz
* Created on: Aug 23, 2015
* Source File:
*/
#include <iostream>
#include <sstream>
#include <string>
/*
*
* @author: Diego Diaz
* Course: COMP B12
* Created on: Apr 23, 2015
* Source File:
*/
#include <iostream>
#include <string>