Questions: 1 835

Answers by our Experts: 1 539

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Search & Filtering

You have created Product class in Lab 1. You need to extend this class and create two derived classes from this class. The derived classes will be DurableProducts (eg: cars, furniture, computers) and NonDurableProducts(Food and Beverages)

The DurableProducts class will have VAT(value added tax) as an additional property. The NonDurableProducts will have ExpiryDate and Discount properties as additional properties.Task 1: Create these two classes by inheriting from the Product class.

Task 2: Override the GetTotalCost () Method in these two classes. For DurableProducts the new total cost will be (Cost + VAT)*Quantity. For NonDurableProducts the new total cost will be (Cost-Discount)*Quantity.Task 3: Create a console application to use these classes. Create a Menu driven application to select the Type of Product. Based on the user selection create the object and accept the details from the user.

Also display the total cost of the Product.


Q#2: Write code Print Statement) that generates the following SMS: Murali (9566171366) is on the way to your location in a Silver Indica AP14F4434. 1.8 times peak time charge is applicable on this booking.
delivery by +orderDate + You can
manage your order at +OrderLink +". Thankyou!"

Q#2: Write code (Print Statement) that generates the following SMS: Murali
(9566171366) is on the way to your location in a Silver Indica AP14F4434. 1.8 times
peak time charge is applicable on this booking.

In the application class (Program.cs), do the following:

Implement the following methods:

static void addRecipient(RecipientList List)

// Requests the name of the student and adds that student to the List

// You may assume that all students are added as Recipients starting with 90 hours

static void updateHours(RecipientList List)

// Requests the name of the student as well as the number of hours worked

// It then updates the hours left

Implement the main method which does the following:

 Ask the user for the number of recipients’ details that needs to be recorded (you can assume

a valid number between 1 and 10).

 Use a loop to obtain the required details from the user (uses addRecipient()).

 Allows the user to update the number of hours for a single student (uses updateHours())

 Displays all the student details from the list


Q1) write generic functions to add, multiply, subtract and divide any kind of data type’s integer, double, decimal and date types.



Q2) write a generic class to implement same above functionalities in your program.


Create a Math Class which contains methods for addition, subtraction, multiplication and division.

Return type of addition and subtraction methods should be void and multiplication and division should return some values.

Task 1: create delegates and call the above functions and use multicast delegates usage

Task 2: using delegate reference call above any one of the method anonymously.

Task 3: remove all the functions addition, subtraction, multiplication and division and call all the methods using lambda expression.

Task 4:Create an dummy event in console based application and call it using a delegate and that delegate should point to one function .Demonstrat how event will call a delegate and how delegate will call a function .


Victor has an array of size n. He loves to play with these n numbers. Each time he plays

with them, he picks up any two consecutive numbers and adds them. On adding both the

numbers, it costs him k*(sum of both numbers).

Find the minimum cost of adding all the numbers in the array.

Input Specification:

input1: Size of array.

input2: Elements of the array.

input3: Value of k.

Output Specification:

Return the minimum cost of adding all the numbers of the array.
Create a class named Product with the following private member variables.

Id of type long, ProductName of type string, SupplierName of type string and Include

appropriate

Getters and setters. Include a 3-argument constructor, 2 argument constructor and a default constructor. Assume that most of the products are supplied by "Nivas" suppliers and in the 2-argument constructor set the value of supplier Name to "Nivas".

Include a method named Display. It does not accept any arguments and its return type is void. Display the details of the product in this method. The method prototype is void Display ();

Create another class and write a man method to test the above class.
Write a program that prompts the user to input a four-digit positive integer. The program then outputs
the digits of the number, one digit per line. For example, if the input is 3245, the output is:
3
2
4
5

This question follow the ones last posted:

Open and edit your console application to use a List Class instead (called RecipientList). Update the Recipient class to include the following method: public void updateHours(int H) //update the hours left – //If a student has worked H hours in the department, the number of hours should decrease by H //It is also possible that number of hours can be increased The List Class should declare the list as an array of 10 Recipient objects, and should contain the following methods: public void Add(Recipient addNew) //adds a new recipient to the list (if list is full, an error message is displayed public int Count() //returns the number of objects in the list public void Display() //Displays all the recipients in the list public int Find(string Wanted) //returns the position of the wanted element in the list private int LinearSearch(string Wanted)


LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS