Quick Print – Computer Sir Ki Class

Login


Lost your password?

Don't have an account ?
Register (It's FREE) ×
  


Shop
siteicon
Solved Problem Solved Problem#CPP#7023

Problem Statement - 04B-2019S-C1

Write a user-defined function TotalPrice() in C++ to read each object of a binary file STOCK.DAT, and display the Name from all such records whose Price is above 150. Assume that the file STOCK.DAT is created with the help of objects of class Stock, which is defined below:

class Stock
{
char Name[20]; float Price;
public:
char* RName() { return Name; }
float RPrice() { return Price; }
};

Solution