Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask C/C++ Expert


Home >> C/C++

Instructions

1. Use Microsoft Visual C# 2010 to create the program.
2. The programs source code must be pasted into word document.

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.

===============----------------------------=============

The solution contains the microsoft word document which keeps the complete program mentioned in above requirement, this is verified and running solution and upto the mark as per the requirement... 

C/C++, Programming

  • Category:- C/C++
  • Reference No.:- M91175172
  • Price:- $40

Priced at Now at $40, Verified Solution

Have any Question?


Related Questions in C/C++

Assign ment - genetic algorithmin this assignment you will

ASSIGN MENT - GENETIC ALGORITHM In this assignment, you will use your C programming skills to build a simple Genetic Algorithm. DESCRIPTION OF THE PROGRAM - CORE REQUIREMENTS - REQ1: Command-line arguments The user of yo ...

1 implement the binary search tree bst in c using the node

1. Implement the Binary Search Tree (BST) in C++, using the Node class template provided below. Please read the provided helper methods in class BST, especially for deleteValue(), make sure you get a fully understanding ...

Assignment word matchingwhats a six-letter word that has an

Assignment: Word Matching What's a six-letter word that has an e as its first, third, and fifth letter? Can you find an anagram of pine grave. Or how about a word that starts and ends with ant (other than ant itself, of ...

What are the legal requirements with which websites must

What are the legal requirements with which websites must comply in order to meet the needs of persons with disabilities? Why is maximizing accessibility important to everyone?

There are several ways to calculate the pulse width of a

There are several ways to calculate the pulse width of a digital input signal. One method is to directly read the input pin and another method (more efficient) is to use a timer and pin change interrupt. Function startTi ...

Software development fundamentals assignment 1 -details amp

Software Development Fundamentals Assignment 1 - Details & Problems - In this assignment, you are required to answer the short questions, identify error in the code, give output of the code and develop three C# Console P ...

Question 1find the minimum and maximum of a list of numbers

Question: 1. Find the Minimum and Maximum of a List of Numbers: 10 points File: find_min_max.cpp Write a program that reads some number of integers from the user and finds the minimum and maximum numbers in this list. Th ...

Project - space race part a console Project - Space Race Part A: Console Implementation

Project - Space Race Part A: Console Implementation INTRODUCTION This assignment aims to give you a real problem-solving experience, similar to what you might encounter in the workplace. You have been hired to complete a ...

Why do researcher drop the ewaste and where does it end

Why do researcher drop the ewaste and where does it end up?

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As