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
public class Hello { | |
public static void main(String[] args) { | |
System.out.print("Hello!\nHow are you doing?\n"); | |
System.out.println("She said \"Hello!\" to me."); | |
} | |
} |
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
public class HelloWorld { | |
public static void main(String[] args) { | |
// generate some simple output | |
System.out.println("Hello, World!"); // first line | |
System.out.println("How are you?"); // another line | |
} | |
} |
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
public class Goodbye { | |
public static void main(String[] args) { | |
System.out.print("Goodbye, "); | |
System.out.println("cruel world"); | |
} | |
} |
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
public class Time { | |
public static void main(String[] args) { | |
int hour, minute, second; | |
// Comments when started program, syntax when finished. | |
// hour = 23; | |
hour = 23; | |
// minute = 49; |
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
public class Date { | |
public static void main(String[] args) { | |
String day, month; | |
int date, year; | |
day = "Friday"; | |
date = 13; | |
month = "July"; |
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
#this program demonstrates some python graphic abilities | |
# the following URL gives a short tutorial on using the turtle | |
# http://www.eg.bucknell.edu/~hyde/Python3/TurtleDirections.html | |
# turtle is used to draw on screen | |
from turtle import * # star is a wildcard | |
# set colors: red line, blue fill | |
color('green', 'blue') |
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
# This program draws the stars of the Orion constellation | |
# the names of the stars, and the constellation lines. | |
import turtle | |
# Set the window size. | |
turtle.setup(500, 600) | |
# Set the window size. | |
turtle.penup() |
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
# Anthony McCann CPW 101 10/22/17 | |
# ch_3_jrn5_ex19.py | |
# Program 3-9 hit_the_target.py | |
# The goal of this exercise was to edit the existing | |
# code for the 'Hit the Target Game' on page 145. | |
# Hit the Target Game | |
import turtle | |
# Named constants |
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
# Chapter 5 Exercise 26 | |
# Anthony McCann CPW 101 11/20/17 | |
# ch5_jrn8_ex26.py | |
# City Skyline | |
# This program draws a city skyline, stars, lighted windows. | |
import turtle | |
import random | |
def main(): |
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
# This program makes a checkerboard pattern using functions. | |
import turtle | |
# Width of one square. | |
WIDTH = 60 | |
NUM_ROWS = 8 | |
def main(): | |
turtle.hideturtle() |
OlderNewer