Question: Assume you need to implement a function named getDescription ( ) in ItemList that accepts a bar code and returns the description of the item

Assume you need to implement a function named getDescription() in ItemList that accepts a bar code and returns the description of the item that matches the bar code. Which of the following is the correct implementation of a function getDescription()?
a.
QString ItemList::getDescription(QString b) const{
return list.value(b)->description;
}
b.
QString ItemList::getDescription(QString b) const{
return list.key(b)->description;
}
c.
QString ItemList::getDescription(QString b) const{
return list.value(b)->getDescription();
}
d.
QString ItemList::getDescription(QString b) const{
return list.key(b)->getDescription();
}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!