Concepts of the object-oriented programming paradigm

Assignment Help C/C++ Programming
Reference no: EM13723270

Object Oriented Programming - Inheritance and access rights - Method Overriding Contributing to the following CLOs:

CLO #1 Review structured programming concepts.

CLO #2 Describe the main concepts of the object-oriented programming paradigm.

CLO #3 Write and Compile programs that incorporate Object Oriented software constructs such as classes, objects, methods.

CLO #4 Apply object oriented concepts such as encapsulation, inheritance, polymorphism, and operator overloading.

1. Use Microsoft Visual C# 2010 to create the program.

2. The programs source code must be pasted into word document.

3. This work should be submitted into moodle website (https://ect.ac.ae/elearn).

Question 1:

Write a C# program that implements the following: 1. Create a Base class named property. ? This class is characterized by the following auto implemented properties: - A propNbr attribute that has a string type - A NbrBedRooms attribute that has an int type - A year attribute that has an int type ? The class property includes also the following methods : - DisplayData () that displays all data about an object property. - A method, called CalculatePrice(), that calculates and returns the property price according to this formula : price = 2000+ NbrBedRooms *1000 .

2. Create a class named Home which is derived from the base class property - This class is is characterized by the following auto implemented properties: - A bool attribute named garden - A bool attribute named garage - The class Home includes also the following methods - DisplayData () that displays all data about an object Home. - A method, called CalculatePrice(), that calculates and returns the property price according to this procedure :

i. Originaly price = 2000 + NbrBedRooms *1000 .

ii. If garage is true, 1000 is added to the price

iii. If garden is true, 2000 is added to the price 3.

In the main method of your program, implement the following: - Create an object called P which is an instantiation of the base class property.

The values of its different attributes are as follows: propNbr= p123, NbrBedRooms = 2, year = 2010 - Create an object called H which is an instantiation of the base class Home.

The values of its different attributes are as follows: propNbr= p130, NbrBedRooms = 3, year = 2012, garage = true, garden= false. - Display the characteristics P. - Calculate and display the price of P. - Display the characteristic of H. - Calculate and display the price of H. The program result looks like the following:

Question 2: Create an object oriented application with C# that allows the user to enter two colors, and then to mix them. The application then should print the resulting color and its details. To construct the application you need to:

1. define a class called Colors characterized by the following attribute and methods: . One private attribute:

o A string Name. . A constructor (with one parameter) to assign a value to the name when creating the object (an instance of a class).

An overloaded operator + to mix two Color objects o For the resulting attribute name use the following table. Color1 Color 2 blue red yellow blue blue purple green red purple red orange yellow green orange yellow.

A method to print the name of an object of the class color.

2. Write am main method that implements the following: . Create two Color objects C1 and C2.

Your program should ask the user to enter name attribute for each object. . Mix C1 and C2 . Display the the resulting color. . The output of the application should look like the following.

Reference no: EM13723270

Questions Cloud

What developments were swirling around the author : What events/developments were swirling around the author at the time the document was produced? Identify the basic features of the document.
How to provide effective help to end-users facing problems : ne of the most critical problems faced by the information technology department in virtually every organization is how to provide effective help to end-users facing problems with the technology
Compatibility issues of merging the sales order data : BMW Bikeworks is the manufacturer of parts for BMW motorcycles. BMW Bikeworks recently purchased a small competitor. In this exercise, you will explore some of the data compatibility issues of merging the sales order data
What is the sigificance of luis valdez in chicano theater : what is the sigificance of Luis Valdez in chicano theater? why do you believe chicano social issues are often presented in chicano artistic expression?
Concepts of the object-oriented programming paradigm : Review structured programming concepts -  Describe the main concepts of the object-oriented programming paradigm.
What are the strengths and weaknesses of the rbs brand : What are the strengths and weaknesses of the RBS brand, Past Promotional Events: Analyze the effectiveness of past RBS consumer and trade promotions
Differentiate between ec and e-business : The Critical Analysis questions are designed to help you gain a deeper understanding of the subject matter, develop an increased ability to apply what you have learned and integrate this knowledge into a greater understanding and appreciation for ..
How did the organization approach the development : How did the organization approach the development and implementation of the new strategy
Explain how the imagery could insult or upset consumers : Singapore Airlines Ad Questions Answer all of the following questions in a 2-3 page paper as they relate to the impact of the ad on consumers from different cultures. Explain how the imagery could insult or upset consumers in other cultures and why

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Write a program which adjusted bill with a sales tax

Write a program which accepts the total of food and drink purchased for a restaurant bill as input. The output should be adjusted bill with a sales tax of six percent 6% and a tip (gratuity) of 15%.

  Program to tests whether they form a magic square

Write a program that reads n2 numbers from standard input and tests whether they form a magic square when put into matrix form.

  Implement a function which computes the minimum cost

Use the min function to determine with a resolution of 0.01 ft the values of Rand L required minimizing the total cost of the fence. Also compute the minimum cost.

  Reduce the numerator and denominator

Write the function  in C ++ to reduce the numerator and denominator in the Rat class to lowest terms.

  Add a non member function

For the code below add the following. Add a non member function that will run the show function of a Sport object. This object is the one parameter of the function.

  Program to produce ten random permutations of numbers

In C++(must be able to compile in Visual Studio ): Write a program to produce ten random permutations of numbers 1 to 10.

  Program that generates 50,000 random integers

Program that generates 50,000 random integers from 1 to 6 (inclusive). Count the number of times that each number occurs and output the totals

  Write a program that reads an array with wind-tunnel test

write a program that reads an array with wind-tunnel test data then allowss the user to enter a flight-path angle. If the angle is within the bounds of the data set, the program should then use linear inteerpolation to compute the corresponding coeff..

  Make a c program that will calculate the gross pay

Write a C program that will calculate the gross pay of a set of employees. For each employee the program should prompt the user to enter the clock number, wage rate, and number of hours as shown below.

  Write a program that displays the cubes of the numbers

Write a program that displays the cubes of the numbers from 1 to 10. Recall that the cubes of a number is just the number multiplied by itself and then by itself again.

  Derive class weekday from class datetime

We can retrieve any one of the date-time structure member using strftime - Derive class WeekDay from class DateTime such that WeekDay::display() will display local date time using values from the parameters and the corresponding weekday.

  Write a program to print the permutation

Write a program to print the permutation that lexicographically precedes the given input permutation.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd