Question: this is for c# using System; class Program { static void Main(string[] args) { Product prod = new Product(AE10145, Motor Cycle, 12.44m); onsole.WriteLine(prod.prodctNumberDetails()); Console.WriteLine(prod.productPriceDetails()); }

this is for c#this is for c# using System; class Program { static void Main(string[]

using System;

class Program {

static void Main(string[] args)

{

Product prod = new Product("AE10145", "Motor Cycle", 12.44m);

onsole.WriteLine(prod.prodctNumberDetails()); Console.WriteLine(prod.productPriceDetails());

}

}

class Product

{

private string ring code;

private string description;

private decimal price;

public Product() {

}

public Product(string code, string description, decimal price) {

this.code = code;

this.description = description;

this.price = price; }

public string Code {

get{return code;

}

set{code = value;}

}

public string Description {

get{return description;} set{description = value;

}

}

public decimal Price {

get{return price;

}

set{price = price;

}

}

public string prodctNumberDetails()

{

return "The Product Number " + code + " is a " + description;

}

public string productPriceDetails() {

return "The Price for Product Number " + code + " is $" + price;

}

} args) { Product prod = new Product("AE10145", "Motor Cycle", 12.44m); onsole.WriteLine(prod.prodctNumberDetails()); Console.WriteLine(prod.productPriceDetails());

Section 2: (100 Points) [Note: For this section create a second project and call it Section-2-000] 1) Create a public class Product with the following a. Fields: i. Code as string ii. Description as string iii. Price as decimal b. Constructor i. An empty constructor ii. An overload constructor with the fields as parameters (Object initializer) c. Properties i. One for each field d. Functions i. A public function that returns a string such as 1. "The Product Number + code + "is a + description. ii. A public function that return a string such as 1. The Price for Product Number + code + "is $+ price. 3) Using the following diagram, create the following classes, Book and Software: [Hint: Product Class is the same as the one in Section 2: Question 1, so no need to repeat it] Product string Code string Description decimal Price string GetDisplayText(string) Book Software string Code string Description decimal Price string GetDisplayText(string) string Code string Description decimal Price string GetDisplayText(string) string Author string Version

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 Databases Questions!