Each of the provided text files represents a working program that requires some maintenance or improvement. Use these files to practice program maintenance on your own, or your instructor may assign them as homework.
In each case, read the description of the required changes, and after the program is successfully modified, save each file using the same filename preceded with FIX. For example, MAINTENANCE01-01.txt will become FIXMAINTENANCE01-01.txt.
If these exercises are assigned as homework, please follow your instructor's directions for submitting your final files.

CODE:

// This program accepts product data about 100 products.
// It displays data about the most expensive product
// and the average price of all products.
// Modify the program to use a Product class to
// hold product data. Include a constructor
// that accepts all the data fields as parameters.
class Product
Declarations
private string idNum
private string description
private num price

public Product(string id, string descrip, num pr)
id = idNum
description = descrip
price = pr
return
public void setIdNum(string id)
idNum = id
return
public void setDescription(string des)
description = desc
return
public void setPrice(num pr)
if pr < 0
price = 0
else
price = pr
endif
return
public string getIdNum()
return idNum
public getDescription()
return description
public num getPrice()
return price
endClass

start
Declarations
num SIZE = 100
Product products[SIZE]
num x = 0
num total = 0
num avg
num highestPrice = 0
string highestId
string higestDescrip
while x < SIZE
products[SIZE] = getData()
total = total + products[x].getPrice()
if products[x].getPrice() > highestPrice
highestPrice = products[x].getPrice()
highestDesc = products[x].getHighest()
highestId = products[x].getIdNum()
endif
x = x + 1
endwhile
avg = total / SIZE
output "The highest priced product is highestId,
highestDescrip, " $", highestPrice
output "The average price of all products is $", avg
stop

Product getData()
string id
string descrip
num price
output "Enter id or "
input id
output "Enter description "
input descrip
output "Enter price "
input price
Product p(id, descrip, price)
return p