Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Projects 1,2,3 and Projects, 5,6,7
- //Daniel Lawson
- //-------------------------------------------------------------------------------------------------------------------------------------
- /**
- * Created by Daniel on 3/14/2016.
- */
- public class Project1 {
- public static void main (String[] args){
- for (int lines = 1; lines <=7;lines++){
- for (int star = 1; star<= lines *-1 +7; star++){
- System.out.print("*");
- }
- for (int spaces =1; spaces <= lines*1; spaces++){
- System.out.print(" ");
- }
- for (int slash =1;slash <= lines*-2 +14;slash++){
- System.out.print("/");
- }
- for (int backSlash =1; backSlash <= lines*2 -2; backSlash++){
- System.out.print("\\");
- }
- for (int spaces =1; spaces <= lines*1; spaces++){
- System.out.print(" ");
- }
- for (int star = 1; star<= lines *-1 +7; star++){
- System.out.print("*");
- }
- System.out.println();
- }
- }
- }
- //-------------------------------------------------------------------------------------------------------------------------------------
- /**
- * Created by Daniel on 3/14/2016.
- */
- public class Project2 {
- public static void main (String[] args){
- line();
- top();
- top();
- line();
- bottom();
- bottom();
- line();
- }
- public static void line (){
- System.out.println("+------+");
- }
- public static void top(){
- for (int lines =1; lines <= 3;lines++){
- System.out.print("|");
- for(int spaces =1; spaces <= lines*-1 +3;spaces++){
- System.out.print(" ");
- }
- System.out.print("^");
- for(int middleSpaces =1; middleSpaces<=lines*2-2;middleSpaces++){
- System.out.print(" ");
- }
- System.out.print("^");
- for(int spaces =1; spaces <= lines*-1 +3;spaces++){
- System.out.print(" ");
- }
- System.out.print("|");
- System.out.println();
- }
- }
- public static void bottom(){
- for (int lines =1; lines <= 3;lines++){
- System.out.print("|");
- for(int spaces =1; spaces <= lines*1 -1;spaces++){
- System.out.print(" ");
- }
- System.out.print("v");
- for(int middleSpaces =1; middleSpaces<=lines*-2 + 6;middleSpaces++){
- System.out.print(" ");
- }
- System.out.print("v");
- for(int spaces =1; spaces <= lines*1 -1;spaces++){
- System.out.print(" ");
- }
- System.out.print("|");
- System.out.println();
- }
- }
- }
- //-------------------------------------------------------------------------------------------------------------------------------------
- /**
- * Created by Daniel on 3/14/2016.
- */
- public class Project3 {
- public static void main (String[] args){
- line();
- top();
- bot();
- line();
- bot();
- top();
- line();
- }
- public static void line(){
- System.out.println("+---------+");
- }
- public static void top(){
- for(int line =1;line<= 4;line++){
- System.out.print("|");
- for(int space =1; space<=line*-1+5;space++){
- System.out.print(" ");
- }
- for(int slash =1; slash<= line*1-1;slash++){
- System.out.print("/");
- }
- System.out.print("*");
- for(int slash =1; slash<= line*1-1;slash++){
- System.out.print("\\");
- }
- for(int space =1; space<=line*-1+5;space++){
- System.out.print(" ");
- }
- System.out.println("|");
- }
- }
- public static void bot(){
- for(int line =1;line<= 4;line++){
- System.out.print("|");
- for(int space =1; space<=line*1;space++){
- System.out.print(" ");
- }
- for(int slash =1; slash<= line*-1+4;slash++){
- System.out.print("\\");
- }
- System.out.print("*");
- for(int slash =1; slash<= line*-1+4;slash++){
- System.out.print("/");
- }
- for(int space =1; space<= line*1;space++){
- System.out.print(" ");
- }
- System.out.println("|");
- }
- }
- }
- //-------------------------------------------------------------------------------------------------------------------------------------
- /**
- * Created by Daniel on 3/16/2016.
- */
- public class Project5 {
- public static final int GUYS = 9;
- public static void main (String[] args){
- for(int stairs = 1; stairs <= GUYS; stairs++){
- //32 total
- // 21 spaces first time
- // 5
- for (int spaces = 1; spaces <= stairs*-5 + GUYS*5 +1; spaces++){
- System.out.print(" ");
- }
- System.out.print(" o ******");
- for (int lastSpaces =1; lastSpaces <= stairs*5 -5;lastSpaces++ ){
- System.out.print(" ");
- }
- System.out.println("*");
- for (int spaces = 1; spaces <= stairs*-5 + GUYS*5 +1; spaces++){
- System.out.print(" ");
- }
- System.out.print("/|\\ *");
- for (int lastSpaces =1; lastSpaces <= stairs*5;lastSpaces++ ){
- System.out.print(" ");
- }
- System.out.println("*");
- for (int spaces = 1; spaces <= stairs*-5 + GUYS*5 +1; spaces++){
- System.out.print(" ");
- }
- System.out.print("/ \\ *");
- for (int lastSpaces =1; lastSpaces <= stairs*5;lastSpaces++ ){
- System.out.print(" ");
- }
- System.out.println("*");
- }
- for(int floor =1; floor<= GUYS * 5 + 7; floor++) {
- System.out.print("*");
- }
- }
- }
- //-------------------------------------------------------------------------------------------------------------------------------------
- /**
- * Created by Daniel on 3/16/2016.
- */
- public class Project6 {
- public static final int SIZE =3;
- public static void main(String[] args) {
- point();
- line();
- upPyramid();
- downPyramid();
- line();
- downPyramid();
- upPyramid();
- line();
- point();
- }
- public static void point() {
- for (int line = 1; line <= SIZE +2; line++) {
- for (int spaces = 1; spaces <= line * -1 + SIZE*2; spaces++) {
- System.out.print(" ");
- }
- for (int dash = 1; dash <= line * 1; dash++) {
- System.out.print("/");
- }
- System.out.print("**");
- for (int dash = 1; dash <= line * 1; dash++) {
- System.out.print("\\");
- }
- System.out.println();
- }
- }
- public static void upPyramid(){
- for (int line =1; line <= SIZE; line++){
- System.out.print("|");
- for(int dot =1; dot<= line*-1 +SIZE ; dot++) {
- System.out.print(".");
- }
- for(int triangle =1; triangle <= line*1; triangle++){
- System.out.print("/\\");
- }
- for(int insideDot =1; insideDot<= line*-2+SIZE*2;insideDot++){
- System.out.print(".");
- }
- for(int triangle =1; triangle <= line*1; triangle++){
- System.out.print("/\\");
- }
- for(int dot =1; dot<= line*-1 +SIZE ; dot++) {
- System.out.print(".");
- }
- System.out.println("|");
- }
- }
- public static void downPyramid(){
- for (int line =1; line <= SIZE; line++){
- System.out.print("|");
- for(int dot =1; dot<= line*1 -1; dot++) {
- System.out.print(".");
- }
- for(int triangle =1; triangle <= line*-1+ SIZE+1; triangle++){
- System.out.print("\\/");
- }
- for(int insideDot =1; insideDot<= line*2-2;insideDot++){
- System.out.print(".");
- }
- for(int triangle =1; triangle <= line*-1+SIZE+1; triangle++){
- System.out.print("\\/");
- }
- for(int dot =1; dot<= line*1 -1; dot++) {
- System.out.print(".");
- }
- System.out.println("|");
- }
- }
- public static void line() {
- //System.out.println("+=*=*=*=*=*=*+");
- System.out.print("+");
- for(int characters =1; characters <= SIZE*2;characters++) {
- System.out.print("=*");
- }
- System.out.println("+");
- }
- }
- //-------------------------------------------------------------------------------------------------------------------------------------
- /**
- * Created by Daniel on 3/16/2016.
- */
- public class Project7 {
- public static final int SIZE = 100;
- public static void main (String args[]){
- normalNeedle();
- pyramid();
- line();
- downwardPyramid();
- normalNeedle();
- percentNeedle();
- percentNeedle();
- percentNeedle();
- percentNeedle();
- pyramid();
- line();
- }
- public static void normalNeedle(){
- for(int dash =1; dash <= SIZE; dash++){
- //12
- for(int space =1; space<=SIZE*3 ;space++){
- System.out.print(" ");
- }
- System.out.println("||");
- }
- }
- public static void pyramid() {
- for (int line = 1; line <= SIZE; line++) {
- for (int space = 1; space <= line * -3 + SIZE * 3; space++) {
- System.out.print(" ");
- }
- System.out.print("__/");
- for (int colon = 1; colon <= line * 3 - 3; colon++) {
- System.out.print(":");
- }
- System.out.print("||");
- for (int colon = 1; colon <= line * 3 - 3; colon++) {
- System.out.print(":");
- }
- System.out.println("\\__");
- }
- }
- public static void line(){
- System.out.print("|");
- for(int quote =1; quote<=SIZE *6;quote++){
- System.out.print("\"");
- }
- System.out.println("|");
- }
- public static void downwardPyramid(){
- for(int line =1; line<= SIZE; line++){
- for(int space =1; space<= line*2 -2;space++) {
- System.out.print(" ");
- }//11
- System.out.print("\\_");
- for(int dash =1; dash <= line*-2 + SIZE*3 +1;dash++){
- System.out.print("/\\");
- }
- System.out.println("_/");
- }
- }
- public static void percentNeedle(){
- for(int dash =1; dash <= SIZE; dash++){
- //12- 3, 11
- for(int space =1; space<=SIZE*3 -3 ;space++){
- System.out.print(" ");
- }
- System.out.println("|%%||%%|");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment