Giter Site home page Giter Site logo

problem-set-1's Introduction

Problem Set 1

Problem Set 1 challenges your ability to print various text, shapes, and figures to the console. You'll use built-in Java methods, along with the escape sequences we've covered, to create some interesting output (as least as interesting as text on a screen can be...).

Getting Started

To get started, you'll need to create a GitHub repository to store your Problem Set 1 code. After cloning my skeleton repository, you'll need to setup a remote to push your code to your repository instead of mine. Steps to accomplish this are outlined below.

Setup

  1. Login to your GitHub account and create a new repository named problem-set-1.
  2. Create a folder on the Desktop named APCSA.
  3. In GitBash, navigate to your APCSA folder.
  4. Clone my skeleton repository from GitHub. This will make a copy of my repository and store it locally.
   >>> git clone [email protected]:rwilson-ucvts/problem-set-1-skeleton.git
  1. The cloning process will have created a folder named problem-set-1-skeleton. Rename this folder to pset1.
   >>> mv problem-set-1-skeleton pset1
  1. Change directories to get into your pset1 folder.
   >>> cd pset1
  1. Originally, the remote will be pointing at my repository. We need to overwrite this.
   >>> git remote rename origin upstream
  1. Lastly, we need to add a new remote that points at the repository you created earlier.
   >>> git remote add pset1 [email protected]:YOUR-USERNAME/problem-set-1.git
  1. Launch Eclipse and set the Workspace to the APCSA folder you created on your Desktop.
  2. From within the Package Explorer (the left-most panel), right-click and select Import....
  3. Select Git > Projects from Git, and click Next >.
  4. Select Existing local repository and click Next >.
  5. Click the Add... button, and then the Browse... button.
  6. Navigate to the APCSA folder on your Desktop, click the pset1 project folder, and click Open.
  7. Select the checkbox next to your project and click Finish.
  8. Now that we've imported the Git project, we can click Next >, Next >, and Finish once more.

Exercises

Problem Set 1 contains 5 exercises, each of which will be written in your main method. You'll notice that there are indicators for where the code for each exercise should be written. Please adhere to these. And perhaps most importantly, challenge yourself! I know you can copy and paste the samepl outputs or find the answers on Google. Try to work through these on your own. You'll thank me later when the exercises become far more complex and the solutions not-so-easily implemented.

Exercise 1

Print APCS to the console in large letters constructed with hashtags (i.e., #). Each letter must be 7 hashtags in height with a single space between letters. You cannot use String concatenation (i.e., the + operator) in your print statements. Your output should match mine exactly.

/// EXERCISE 1 /////////////////////////////////////////////////

   ##    ######  ######## ########
  #  #   #     # #        #
 #    #  #     # #        #
######## ######  #        ########
#      # #       #               #
#      # #       #               #
#      # #       ######## ########

Exercise 2

Print 3 consecutive diamonds to the console using forward and backslashes only. Each diamond should be 6 slashes in height with a single space between each diamond. You cannot use String concatenation (i.e., the + operator) in your print statements. Your output should match mine exactly.

/// EXERCISE 2 /////////////////////////////////////////////////

  /\     /\     /\
 /  \   /  \   /  \
/    \ /    \ /    \
\    / \    / \    /
 \  /   \  /   \  /
  \/     \/     \/

Exercise 3

Print a face to the console using only the System.out.print method. You are not allowed to use System.out.println at all. Your face should be 6 lines in height. You cannot use String concatenation (i.e., the + operator) in your print statements. Your output should match mine exactly.

/// EXERCISE 3 /////////////////////////////////////////////////

   \\\\\
  +"""""+
(|  0 0  |)
 |   ^   |
 |  '-'  |
  +-----+

Exercise 4

Using a single print statement (either System.out.print or System.out.println), print the following figure to the console. There is a single space between each letter on the top and bottom of the box. The rest of the spacing should be easily dedicible. You cannot use String concatenation (i.e., the + operator) in your print statements. Your output should match mine exactly.

/// EXERCISE 4 /////////////////////////////////////////////////

H E L L O
E       A
L       P
L       C
O A P C S

Exercise 5

Print the following text, including the quotation marks, to the console. You cannot use String concatenation (i.e., the + operator) in your print statements. Your output should match mine exactly.

/// EXERCISE 5 /////////////////////////////////////////////////

"The answer's quite simple," the professor said. "Just think outside the box!"

Deadline

Your Canvas submission is due at or before 11:59pm on your section-specific due date.

  • September 18, 2018 (A 9/10)
  • September 20, 2018 (B 1/2)

Submission Requirements

All that is required for submission is the URL to your GitHub repository for this problem set.

problem-set-1's People

Contributors

ecarr0 avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.