Create a contructor with default parameters

Assignment Help Programming Languages
Reference no: EM131137839

Create a class called Box which has private data members: length and width, both float area, found from length and width name which is a dynamic string constructor

1) create a contructor with default parameters of 1 for length and width.

2) the constructor should calculate ther area member frm length and width.

3) add a static member called total_area.In the constructor,add the area of the box created toi total_area variable.

4) add a comment with cout<<creating a box using the name data member. member function create a member function called perimeter() which finds the perimeter of a box,and returns this value. p=2(L+W) WHERE p=perimeter, L=length , W=width Non-member function create a non member friend function called fits.this function takes 2 boxes as arguments(pass b reference) and returns true if the first box would fit inside the second box , else return false. one way to tell if box A fits in box B is if the length of A< length of B and width of A<width of NB destructor create destructor the iutputs a message deleting a box usig its name member in main(); instaniate 3 boxes with the constructor using code: Box b1("first",2,3); Box b1("second",5); Box b1("third"); use the perimeter function for one of the boxes use the fits function for anty two of the boxes casll the function froom main() something like if(fits(b1.b2)) cout<<"box fits\n"; else cout<<"box doesn't fit\n"; when program finishs print out total area of the 3 boxes from this variable.

Reference no: EM131137839

Questions Cloud

If price of a good is set higher than equilibrium price is : If the price of a good is set higher than the equilibrium price: - Suppose that quantity supplied of a product equals 5 and quantity demanded equals 8. In this market, there is a:
The critical region of the likelihood ratio test : The number of successes in n trials is to be used to test the null hypothesis that the parameter θ of a binomial population equals 1/2 against the alternative that it does not equal 1/2.
Write commands to solve the system of equations : Write MATLAB commands to solve the system of equations. 7x-14y=95 -5x+9z=-50 -5x+15z=145
Compute the break-even point in dollars : Scottsdale Ltd.  has the following cost information available for various months of production: Compute the break-even point in dollars
Create a contructor with default parameters : Create a class called Box which has private data members: length and width, both float area, found from length and width name which is a dynamic string constructor
The effects of fluctuating groundwater levels : Interpret and discuss these plots with respect to the effects of fluctuating groundwater levels.
Effect do the closing costs have on the effective a i r : If the loan in Problem 22 is paid off at the end of the thirtieth month (at the time of the 30th payment) what effect does this have on the effective annual interest rate?
An example of a normative question : Which is an example of a normative question? - What are the long-term effects of unemployment? - How do interest rates influence employment?
Calculate the hydraulic conductivity : Estimate the hydraulic conductivity of a similar soil with a porosity of 35% from the results of this test.

Reviews

Write a Review

Programming Languages Questions & Answers

  Write application to retrieve the telephone number

Consider a program to enter codes of one to eight characters along with an associated telephone number and associated notes. A code can represent a person's name, a person's initials, a place, or anything.

  Write a prolog program to solve the sudoku puzzle

Write a Prolog program to solve the 6 by 6 Sudoku puzzle distributed in class. Do not use a solution downloaded from the Internet or elsewhere. Write your own. It should be designed along these lines: Label the squares X1, X2, ..., X36 as discuss..

  Write and debug a mips program

Write and debug a MIPS program that performs the given operations - Display one of the following statements depending on if a>b, or a=b or a

  Write code for the missing sections

Use the following code outline as a starting point for your final project. You will need to correct any errors you find and write code for the missing sections.

  Discuss when scripting should be taught to individuals

Discuss when scripting should be taught to individuals who are learning software programming and discuss the advantages and disadvantages of doing so at specific times in their learning process.

  Functioning program that addresses behavioural design

ITECH2100 / ITECH6100. Task-2: Code a functioning program that addresses the behavioural and additional design requirements Write the classes that you have determined are needed to make a functioning program

  Write web application that will give report of balance

Write the web application that will give a report of the balance held in a visitor's account during past several months.

  Write complete payroll program for a company

Now, write a complete PAYROLL program for a company in which each employee falls into one of the 3 categories - Administrative, FactoryEmployee or Salesperson.

  Create a query that lists the following fields

Create a query that lists the following fields, in the order in which they appear below:

  Write program which inputs employee name

Write the program which inputs Employee Name and Tuition and prints, for each employee, Name and Rebate Amount.

  Compute and display number of miles per hour

Once correct data has been entered, the program muts compute and display number of miles per hour over the speed limit that the driver was doing.

  How are intelligent agents used on the internet

Define Business Performance Management and how DSS relates the Business Performance Management.

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