Review structured programming concepts

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

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.

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 propNbrattribute that has a string type
- A NbrBedRoomsattribute 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 Homewhich 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.

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 resultingcolor 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:
    • 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
    • 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: EM13723418

Questions Cloud

The performance appraisal is often a topic of debate. : The effectiveness of the performance appraisal is often a topic of debate. Read the Forbes article, "Eliminating Performance Appraisals". Based on the content of the article, identify three key points related to the author's position on the eli..
The cultural differences of the team members : CULTURAL DIVERSE TEAM - How will you improve company's morale. Identify the steps you will take keeping in mind the cultural differences of the team members.
Human resource management: ethical dilemma : You've been working as a talent specialist in Human Resources at Megacorp Manufacturing for about 3 years. Recently, you were asked to meet with the company president to help with hiring a new office staff member. You're nervous because this is..
Design a program in jgrasp using java code : Design a program in jGRASP using Java code to process students' scores and determine the final course grade  for each student in an ELAC class. Name this class YourEtudesUserIdD_PreTest5.java. The final course  grade is based on the total maximum ..
Review structured programming concepts : Review structured programming concepts - Describe the main concepts of the object-oriented programming paradigm.
How it derives strategic benefits from its efforts : Ethics and CSR and Marketing Strategy (2pages Max), Describe the means by which a company (other than Honest Tea) engages in CSR and how it derives strategic benefits from its efforts
Define process design and supply chains : This is part one of a two part assignment starting with an introductory look at process design and supply chains. Identify a company with which you are familiar. This could be your place of employment, a car wash, a yard service company, and so fo..
Human resources decision making : Analyze the various strategies involved with "rightsizing" and determine possible ethical issues resulting from those strategies. Please give specific examples
Explain the israeli and palestinian narrartives in perpetuat : I need 2 pages about: Discuss the impact of the gap between the Israeli and Palestinian narrartives in perpetuating the Arab - Israeli conflict.

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Write a program that allows user to input students names

Write a program that allows the user to input the students' names followed by their test scores and outputs the following.

  C program to compute parking fare for customers

Write C program to compute parking fare for customers who park their cars in parking lot when following information is provided: A character showing type of vehicle: C for car, B for bus and T for truck

  Nbspyou are to insert the missing code in the c program

nbspyou are to insert the missing code in the c program given for combinational equivalence checking. this program will

  Display the array, the average and the number of days above

Write a program that stores the daily temperatures for the month of April in an array name dailytemp. Calculate the average temperature for the month and the count the number of days that the daily temperature was above the average.

  Each person in your team will complete one sequence

each person in your team will complete one sequence problem problem 1 or 2. one selection problem problems 3 4 or

  Write a function named short_path

Write a function named 'short_path' which has two input parameters {M, N} and one output parameter T.

  Binary tree, print right view of it

Given a Binary Tree, print Right view of it. Right view of a Binary Tree is set of nodes visible when tree is visited from Right side.

  Write a function that moves the largest item

Write a function that moves the largest item on a given linked list to be the final node on the list

  Objectivein this assignment you read a list of employees

objectivein this assignment you read a list of employees from a csv file and convert them into corresponding objects.

  Write a program that first prompts the user

Write a program that first prompts the user (repeatedly , if necessary) to supply a single digit(0,1,2..9) The program should repeatedly prompt the user for integer values until a sentinel value of 0 is entered to terminate the program.

  Write a function to compute the magnitude f

write a function to compute the magnitude F and direction angle of a two-dimensional force F by using two components of the force fx,fy as its parameters,returning F and using the reference to pass theta value .

  The staffs need a program that can determine

The staffs need a program that can determine whether children have been naughty or nice. individual data files(can be any name) for each childred are available that consist of 368(365+3)integer number each.

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