expressions

expressions - /* * expressions.cpp * * * Created by Clark,...

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

View Full Document Right Arrow Icon

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

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

Unformatted text preview: /* * expressions.cpp * * * Created by Clark, Ivory on 3/26/08. * Copyright 2008 __MyCompanyName__. All rights reserved. * */ //Expressions #include <iostream> using namespace std; void display_main_menu(){ cout<<" Main Menu "<<endl; cout<<"1.Draw a Shape"<<endl; cout<<"2.Draw a Facial Expression"<<endl; cout<<"3.Quit"<<endl; cout<<"Choose an option:"<<endl; } void display_shape_menu(){ cout<<" Draw A Shape "<<endl; cout<<"1.Draw a Line."<<endl; cout<<"2.Draw a Square."<<endl; cout<<"3.Draw an 'X'."<<endl; cout<<"4.Return to Main Menu."<<endl; cout<<"Choose an option:"<<endl; } void draw_a_line(){ //variable declarations int row, width; //prompting the user cout<<"Please enter a value between 8 and 40 for the width."; cin>>width; //draw the line for(row=0;row<=width;row++){ cout<<"*"; } } void draw_a_square(){ //variable declarations int row, col, width; //prompting the user cout<<"Please entera value between 8 and 40 for the width."; cin>>width; //draw the square for(row=0;row<width;row=row+1){ for(col=0;col<width;col=col+1){ if((row==0)||(row==width-1)||(col==0)||(col==width-1)) cout<<"*"; else cout<<" "; } cout<<endl; }...
View Full Document

This document was uploaded on 05/01/2011.

Page1 / 4

expressions - /* * expressions.cpp * * * Created by Clark,...

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