PrepAway - Latest Free Exam Questions & Answers

Which code segment should you use?

You create Web-based client applications. You are creating a class named Product. The Product class will be used by a Web-based application to retrieve and modify product information.

When you create an instance of the Product class, you retrieve the current information from the Products table. The Product class contains a static member named CreateNewProduct. The CreateNewProduct method is used to add a new product to the database and return the primary key.
The Products table contains the following fields:

ProductID (primary key)
ProductName
Description
CategoryID
CurrentPrice

You need to create the constructor for the Product class. Which code segment should you use?

PrepAway - Latest Free Exam Questions & Answers

A.
public Product(int ProductID, string ProductName, string Description, int CategoryID, decimal CurrentPrice) {

}

B.
public Product(int ProductID, string ProductName) {

}

C.
public Product() {

}

D.
public Product(int ProductID) {

}


Leave a Reply