bumpkin

# bumpkin - b=b*3*12*2.52; }else // conversion of bumpkins...

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

#include <iostream> #include <string> using namespace std; int main() { int k; //number of doors int i; //number of bumpkins int n; // number of doors to go through int num; //nuber of bumpkins char bu; //measurement unit of bumpkin height char du; //measurement unit of door string name; //name of bumpkin float d; //height of door float b; //height of bumpkin cin>>num; k=1; i=0; // My Bumpkin processing while loop while(i<num){ cin>>name>>n>>b>>bu; // conversion of bumpkin's height from inches to centimeters if(bu=='i'){ b=b*2.52; } else // conversion of bumpkins height from feet to centimeters if(b=='f'){ b=b*12*2.52; } else // conversion of bumpkins height form yard to centimeters if(bu=='y'){

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: b=b*3*12*2.52; }else // conversion of bumpkins height form meters to centimeters if(bu=='m'){ b=b*100; } cout<<"b="<<b<<endl; // # of dooors to come through while(k<=n){ cin>>d>>du; if(bu==i){ d=d*2.52; } k=k+1; } i=i+1; } if(d>b*1.25) cout<<name<<endl<<"doorway"<<k<<endl; else if(b*1.25) cout<<name<<"stilts"<<k<<endl; else if ((b*1.25>=d)&&(d>b*1.05)) cout<<name<<"walk"<<k<<endl; else if ((b*1.05>=d)&&(d>b*0.65)) cout<<name<<"duck"<<k<<endl; else if ((b*0.65>=d)&&(d>b*0.40)) cout<<name<<"crawl"<<k<<endl; else if ((b*0.40>+d)&&(d>b*0.25)) cout<<name<<"limbo"<<k<<endl; else if(b*0.25>=d){ cout<<name<<"blocked"<<k<<endl; } return 0; }...
View Full Document

## This document was uploaded on 05/01/2011.

### Page1 / 2

bumpkin - b=b*3*12*2.52; }else // conversion of bumpkins...

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

View Full Document
Ask a homework question - tutors are online