Site hosted by Angelfire.com: Build your free website today!

  problem 7:c++ 

#include <iostream>

#include <conio.h>

using namespace std;

void main ()

{

            int rent[5] = {500, 750, 495, 800, 940};

            int dummy;

            while ( dummy != 128 && dummy != 204 && dummy != 601 && dummy != 609 && dummy != 612)

            {

                        cout<<"Please enter the street address:  ";cin>>dummy;

                        cout<<endl;}

           

switch (dummy)

{

case 128: cout<<"The rent for that address is "<<"$"<<rent[0]; break;

            case 204: cout<<"The rent for that address is "<<"$"<<rent[1]; break;

                        case 601: cout<<"The rent for that address is "<<"$"<<rent[2]; break;

                                    case 609: cout<<"The rent for that address is "<<"$"<<rent[3]; break;

                                                case 612: cout<<"The rent for that address is "<<"$"<<rent[4]; break;

            }

cout<<endl;

}