Lab Assignment 4

Lab Assignment 4 - Objectives: Become familiar with...

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

View Full Document Right Arrow Icon
Lab Assignment 4 Objectives: Become familiar with repetition structures ( while and for loops) Become more familiar with output formatting, conditional expressions, and program structuring. A. Write a program which prints out a Christmas Tree, using three for loops. The outer loop should control printing of 24 lines. Inner loop 1 controls how many blanks are printed in a line before asterisk printing starts. Inner loop 2 controls how many asterisks are printed in a line. The tree should be 24 lines high. The tree should be uniform with the top looking something like the following : * *** ***** ******* ********* B. Write a program solution to print all integer values  between  1 and n that  are multiples of 5 (i.e. evenly divisible by 5). This should be done with  nested  while  loops. An inner  while  loop is controlled by a conditional  expression determining when the last value for a particular  n  has been  printed. An outer  while
Background image of page 1

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

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 2

Lab Assignment 4 - Objectives: Become familiar with...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online