{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

comp11f09lab3 - Comp 11 Fall 2009 Lab 3 Lucy in the sky...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Lucy in the sky with diamonds (and squares) 1. Command Review - just in case... Command Description Example pwd Print the working directory. pwd ls List the files and subdirectories ls cd Change the working directory cd /home/files cp Copy file(s) from one place to another cp hello.txt /home/files/ mv Move / Rename files mv /source/hello.txt /home/ rm Remove/delete file(s) specified rm /home/files/hello.txt mkdir Make a new directory mkdir comp11directory man Display the manual page for a command or function man ls g++ Compile source code into a binary program g++ -o progname code.cpp emacs Edit source code or other text in the terminal emacs somecode.cpp & 2. Introduction Today you will write two functions to print shapes --- ascii style! Yes were are rocking it old school, way old school. Your job is to write two functions: void printSquare(int size); void printDiamond(int size); The output of the function print square when size is 11 is: *********** *********** *********** *********** *********** *********** *********** *********** *********** *********** *********** Comp 11 Fall 2009 Lab 3 Page 1/2
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
The output of the function printDiamond(11) is: * *** ***** ******* ********* *********** ********* ******* ***** *** * Some hints: 1. Use nested loops!
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}