Page 187 - C++
P. 187

char VDesc[10]: //Vehicle Description

               float Price;

        public:

               void GET() {cin>>VN0;gets! VDesc) ;cin>>Price;}

               void VIEW()

               {

               cout<<VNO<<endl ;

               cout<<VDesc<<endl;

               cout<<Price<<endl;

               }

               float ReturnPrice()

               {
               return Price;


               }
        };


        Ans.
        void show()

        {

               ifstream fcin("VINTAGE.DAT", ios::in|ios::binary);

               VINTAGE V;

               float pr;

               while(fcin.read((char*)&V, sizeof(V)))

               {

                       pr = V.ReturnPrice();

                       if(pr>=200000 && pr<=250000)

                       {

                              V.VIEW();

                       }

               }

        fcin.close();
   182   183   184   185   186   187   188   189   190   191   192