This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** PROGRAM ASSIGNMENT 5 Movie.java | |
* | |
* Program Description | |
* This is the Movie class, which includes instance variables and instance | |
* methods that describe the Movie abstract data type. | |
* | |
*/ | |
package library.films; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** PROGRAM ASSIGNMENT 5 Profitable.java | |
* | |
* Program Description | |
* This is the Profitable interface, to be implemented in the Movie class | |
* and inherited by its subclasses. | |
* | |
*/ | |
package library.films; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** PROGRAM ASSIGNMENT 5 Drama.java | |
* | |
* Program Description | |
* This is the Drama class, a subclass of the Movie class. | |
* | |
*/ | |
package library.films; | |
public class Drama extends Movie { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** PROGRAM ASSIGNMENT 5 Documentary.java | |
* | |
* Program Description | |
* This is the Documentary class, a subclass of the Movie class. | |
* | |
*/ | |
package library.films; | |
public class Documentary extends Movie { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** PROGRAM ASSIGNMENT 5 CalebSabatiniP5.java | |
* | |
* Program Description | |
* This is the client code for the Movie class and its subclasses, which | |
* allows the user to navigate a Warren movie theater menu. | |
* | |
*/ | |
import library.films.*; | |
import java.util.Scanner; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** PROGRAM ASSIGNMENT 5 Animated.java | |
* | |
* Program Description | |
* This is the Animated class, a subclass of the Movie class. | |
* | |
*/ | |
package library.films; | |
public final class Animated extends Movie { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Scanner; | |
import java.util.Arrays; | |
public class Square { | |
public static void drawSquare(int dim) { | |
// Create an array with one string element to contain each row | |
String arr[] = new String[dim]; | |
Arrays.fill(arr, ""); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Scanner; | |
public class Power { | |
public static int pow(int x, int n) { | |
if (n == 0) | |
return 1; | |
else | |
return x * pow(x, n-1); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from __future__ import print_function | |
from bs4 import BeautifulSoup | |
from urlparse import urlparse | |
from urlparse import parse_qs | |
import sys, logging | |
import mechanize | |
import time | |
import csv | |
import sqlite3 | |
import requests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# MySQLdb - http://sourceforge.net/projects/mysql-python. Download MySQL-python-1.2.4b4.win32-py2.7.exe | |
# MySQL 5.6 Community. Download mysql-installer-web-community-5.6.23.0 | |
import MySQLdb | |
db = MySQLdb.connect("localhost", "user", "pw") | |
cursor = db.cursor() | |
sql = 'CREATE DATABASE census' | |
cursor.execute(sql) | |
db.close() |
OlderNewer