Sei sulla pagina 1di 1

ENEE150HW1 -- Spring 2014 Assignment 1 due Monday Feb 3 before 11:59pm

General ENEE150 homework rules:


- the anser of ea!h homeor" prob#em is submitted in a separate dire!tory or fo#der named
$%rob#em1$& $%rob#em2$& et!' hi!h !ontains the set of fi#es ne!essary to bui#d (and here re)uired&
test* the prob#em so#ution' +n genera# this means sour!e '! fi#es and 'h fi#es a#ong ith a Ma"efi#e& but
not the program e,e!utab#e or any ob-e!t ('o *& debug dump-fi#es& or any other generated fi#es un#ess
spe!ified' .his means you must $!#ean$ a## but your sour!e and bui#d fi#es from the dire!tory before
/ipping it'
- ea!h of the indi0idua# prob#em dire!tories are to be stored in the homeor"$s submission dire!tory&
hi!h i## be named ith the name of the homeor"' For e,amp#e& this homeor"$s top-#e0e#
dire!tory is to be named $1211150341$'
- entire homeor" dire!tory is to be submitted in a $'/ip$ fi#e using the $/ip$ uti#ity& e'g'
$ zip -r nameofzip workdirectorytop
- homeor" so#utions must 'make' and execute on the glue computer system for grading5if your
program fai#s to !ompi#e or e,e!ute e !annot e0a#uate it'
- ea!h homeor" prob#em i## be s!ored 1 to 4 a#ong the ordinate
undeveloped/developing/competent/mastery of the prob#em$s primary topi!' .he prob#em$s
!ontribution to the o0era## grade i## be e0a#uated #ater in the !onte,t of the prob#em$s re#ati0e
diffi!u#ty'
Prolem1: d!amondsma!n"c d!amond#unct!ons"c
4rite a 6 main(* program in $diamondsmain'!$ hi!h !a##s fi0e separate fun!tions in
$diamondfun!tions'!$ hi!h ea!h print a symmetri! diamond-shaped b#o!" of 789 !hara!ters on the
!onso#e disp#ay' 1a!h fun!tion i## ta"e the height (in #ines* and idth (in !hara!ters* of the diamond
as parameters passed in from the !ommand #ine& e'g'
: diamonds 100 30
and i## print a diamond of height 100 and idth 30& fi0e times'
.he physi!a# dimensions of the disp#ay shou#d be assumed to be ;0 !o#umns ide and
(potentia##y* 4 7g#ines9 (giga#ines& a made-up term* high' .he diamond shou#d be !entered 0erti!a##y at
the !enter of the ;0 !o#umns (e'g' at !o#umn 740'59* hen idth is an e0en number and at !o#umn 40
hen idth is an odd number& and is to be trun!ated on ea!h side hen the #ine idth is greater than
the ;0-!o#umn disp#ay a##os' .he fi0e fun!tions you rite to so#0e this prob#em must fo##o the
!onstraint ru#es be#o:
usingany(* : prints the diamond using any method you #i"e<
on#yhi#e(* : prints the diamond using on#y 7hi#e9 #oops<
on#ydohi#e(* : prints the diamond using on#y 7do-hi#e9 #oops<
on#yfor(* : prints the diamond using on#y 7for9 #oops<
on#yinfinite(* : prints the diamond using on#y 7infinite9 #oops'

Potrebbero piacerti anche