6.6 Lab: Rectangle Class This program creates a Rectangle object, then displays the rectangle's length, width,...

6.6 Lab: Rectangle Class

This program creates a Rectangle object, then displays the rectangle's

  • length,

  • width, and

  • area

    Change this program to calculate and display the rectangle's

  • perimeter.

Example:

In feet, how wide is your house? 20
In feet, how long is your house? 25
The house is 20.00 feet wide.
The house is 25.00 feet long.
The house has 500.00 square feet of area.
The house has 90.00 feet of perimeter.

/**
This program creates a Rectangle object, then displays the rectangle's
- length,
- width, and
- area

Change this program to calculate and display the rectangle's
- perimeter.

*/

#include <iostream>
#include <iomanip>
using namespace std;

class Rectangle
{
private:
double width;
double length;
public:
// setters
void setWidth(double w) { width = w; }
void setLength(double len) {length = len; }
  
// getters
double getWidth() const { return width; }
double getLength() const { return length; }
  
// other functions
double calculateArea() const { return width * length; }
/* Write your code here */
};


int main()
{
double houseWidth; // To hold the room width
double houseLength; // To hold the room length

// Get the width of the house.
cout << "In feet, how wide is your house? ";
cin >> houseWidth;

// Get the length of the house.
cout << "In feet, how long is your house? ";
cin >> houseLength;

// Create a Rectangle object and use setters to assign values to its data members
Rectangle house;
  
house.setWidth(houseWidth);
house.setLength(houseLength);
  
// Display the house's width, length, and area.
cout << setprecision(2) << fixed;
cout << endl;
cout << "The house is " << house.getWidth()
<< " feet wide.\n";
cout << "The house is " << house.getLength()
<< " feet long.\n";
cout << "The house has " << house.calculateArea()
<< " square feet of area.\n";

// Display the perimeter below
/* Write your code here */
  
return 0;
}
/***************************************************************
Save the OUTPUT below


*/
//Change the code only ever so slighty, not using advanced algorithims

In: Computer Science

Design and implement a Java program to create a GUI application that for calculating an employee’s...

Design and implement a Java program to create a GUI application that for calculating an employee’s travel expenses and reimbursement. The user will enter the following data:

∙ Number of days on the trip

∙ Amount of the airfare, if any

∙ Amount of car rental fees, if any

∙ Number of miles driven, if a private vehicle is used

∙ Amount of parking fees, if any

∙ Amount of taxi charges, if any

∙ Conference or seminar registration fees, if any

∙ Lodging charges, per night

Once all expanses are entered the program should then calculate what the employee’s reimbursement will be based on the following guidelines:

∙ $17 per day for meals

∙ Parking fees, up to $10.00 per day

∙ Taxi charges up to $20.00 per day

∙ Lodging charges up to $95.00 per day

∙ If a private vehicle is used, $0.27 per mile driven

Once calculated your program should display the following information:

∙ Total expenses incurred by the business person

∙ The total allowable expenses for the trip

∙ The excess that must be paid by the business person, if any

∙ The amount saved by the business person if the expenses are under the total allowed

The layout and formatting of your GUI interface should be creative, attractive and easy to use.

In: Computer Science

A 0.300 g sample of an aspirin tablet is used to prepare 100.0 mL of a...

A 0.300 g sample of an aspirin tablet is used to prepare 100.0 mL of a stock solution by dissolving the tablet in 1 M NaOH then diluting with distilled water to the 100 mL mark of a volumetric flask.  A 0.30 mL sample of the stock solution is then transferred to a volumetric flask and diluted with 0.02 M iron(III) chloride to the 10.00 mL mark.  The tetraaquasalicylatoiron(III) complex concentration in this 10.00 mL sample is determined to be 4.3x10-4M.  What is the percentage of acetylsalicylic acid in the original aspirin tablet?  Do not include the % sign in your answer.  For example, for a value of 100% enter 100.

Would really like a step by step answer. So i can understand the process.

In: Chemistry

I need this in C++ please. I started it, but I need to add Get Average,...

I need this in C++ please. I started it, but I need to add Get Average, Get Row total, and Get highest in row to my source code. But I keep getting build errors. Can someone please help me with my code. I attached my code after the question. Thank you!

Write a program that create a two-dimensional array initialized with test data. The program should have the following functions:

getTotal - This function should accept two-dimensional array as its argument and return the total of all the values in the array.

getAverage - This function should accept a two-dimensional array as its argument and return the average of values in the array.

getRowTotal - This function should accept a two-dimensional array as its first argument and an integer as its second argument. The second argument should be the subscript of a row in the array. The function should return the total of the values in the specified row.

getColumnTotal - This function should accept a two-dimensional array as its first argument and an integer as its second argument. The second argument should be the subscript of a column in the array. The function should return the total of the values in the specified column.

getHighestInRow - This function should accept a two-dimensional array as its first argument and an integer as its second argument. The second argument should be the subscript of a row in the array. The function should return the highest value in the specified row in the array.

getLowestInRow - This function should accept a two-dimensional array as its first argument and an integer as its second argument. The second argument should be the subscript of a row in the array. The function should return the lowest value in the specified row in the array.

Demonstrate each of the function in this program.

my source code:

#include <iostream>
using namespace std;

const int ROWS = 4;
const int COLS = 5;

int getTotal(int [][COLS], int, int);
int getColumnTotal(int [][COLS], int, int);
int getLowestInRow(int [][COLS], int, int);


int main()

{
   int paArray[ROWS][COLS] = { {1, 2, 3, 4, 5}, {6, 7, 8, 9, 10}, {11, 12, 13, 14, 15}, {16, 17, 18, 19, 20} };

   cout << "The total equals " << getTotal(paArray, ROWS, COLS) << "\n";
   cout << "The total of column 3 is " << getColumnTotal(paArray, 3, ROWS) << "\n";
   cout << "The lowest in row 3 is " << getLowestInRow(paArray, 3, COLS) << "\n";

   system("pause");
   return 0;
         
}

int getTotal(int array[][COLS], int rows, int cols)
{
   int sum = 0;

   for (int row = 0; row < rows; row++)
   {
       for (int col = 0; col < cols; col++)
           sum += array[row][col];
   }

   return sum;
}

int getColumnTotal(int array[][COLS], int colToTotal, int rows)
{
   int sum = 0;
   for (int row = 0; row < rows; row++)
   {
       sum += array[row][colToTotal];
   }

   return sum;
}

int getLowestInRow(int array[][COLS], int rowToSearch, int cols)
{
   int lowest = array[rowToSearch][0];

   for (int col = 1; col < cols; col++)
   {
       if (array[rowToSearch][col] < lowest)
           lowest = array[rowToSearch][col];
   }

   return lowest;
}

In: Computer Science

Marketing researchers have access to a great deal of information about consumers. What kinds of pressure...

  1. Marketing researchers have access to a great deal of information about consumers. What kinds of pressure might be brought to bear on a marketing researcher that might cause ethical dilemmas?
  2. In 2005, a new federal law allowed consumers once-a-year free access to their credit reports. Many consumers who accessed their credit reports were surprised by the amount of information collected. What can marketers and marketing researchers do to minimize consumers' privacy fears?
  3. What role do YOU (as the consumer) play in protecting your own privacy? In other words, what can you do to protect your privacy and what are ways that we give up access to our privacy?

In: Accounting

You just bought a car and plan on driving to campus everyday. The university no longer...

You just bought a car and plan on driving to campus everyday. The university no longer offers free parking because of
the increase of parking needs. You have two options to buy a parking permit. A monthly permit costs $30 (due at the
end of each month), which is a pay-as-you-go plan and you pay every month. However, the auxiliary services offers
a discounted annual permit which only costs $250 (upfront). You may assume that the academic year (12 months)
starts from Sep 1st, and ends on Aug 31st.
(1) If you plan to use the permit for all 12 months of the year, what is your internal rate of return (implicit interest
rate)?
(2) If you are not going to be on campus during the summer break (two months, from Jun 1st to Aug 31st), is
your internal rate of return going to change? If so, how much?
(3) You heard that a partially used annual permit can be sold easily on the black market for $15×number of
remaining months unused, because the parking permit is not associated with the car plate and can be used by any car
in the same class. How this is going to change your internal rate of return?

In: Finance

If you have a bowl of ice that's melting, so the ambient temperature is just above...

If you have a bowl of ice that's melting, so the ambient temperature is just above 0

In: Physics

Chapter 8 - Master it! In practice, the use of the dividend discount model is refined...

Chapter 8 - Master it!
In practice, the use of the dividend discount model is refined from the method we presented in the textbook. Many analysts will estimate the dividend for the next 5 years and then estimate a perpetual growth rate at some point in the future, typically 10 years. Rather than have the dividend growth fall dramatically from the fast growth period to the perpetual growth period, linear interpolation is applied. That is, the dividend growth is projected to fall by an equal amount each year. For example, if the high growth period is 15 percent for the next 5 years and the dividends are expected to fall to a 5 percent perpetual growth rate 5 years later, the dividend growth rate would decline by 2 percent each year.
The Value Line Investment Survey provides information for investors. Below, you will find information for IBM found in the 2014 edition of Value Line:
2014 dividend: $               3.95
5-year dividend growth rate: 9.5%
Although Value Line does not provide a perpetual growth rate or required return, we will assume they are:
Perpetual growth rate: 4.0%
Required return: 11.0%
a. Assume that the perpetual growth rate begins 10 years from now and use linear interpolation between the high growth rate and perpetual growth rate. Construct a table that shows the dividend growth rate and dividend each year. What is the stock price at Year 10? What is the stock price today?
b. How sensitive is the current stock price to changes in the perpetual growth rate? Graph the current stock price against the perpetual growth rate in 10 years to find out.
Instead of applying the constant dividend growth model to find the stock price in the future, analysts will often combine the dividend discount method with price ratio valuation, often with the PE ratio. Remember that the forward PE ratio is the current price per share divided by the earnings per share next year. So, if we know what the PE ratio is, we can solve for the stock price. Suppose we also have the following information about IBM:
Payout ratio: 25%
Forward PE ratio at constant growth rate: 15
c. Use the forward PE ratio to calculate the stock price when IBM reaches a perpetual growth rate in dividends. Now find the value of the stock today finding the present value of the dividends during the supernormal growth rate and the price you calculated using the PE ratio.
d.

How sensitive is the current stock price to changes in PE ratio when the stock reaches the perpetual growth rate? Graph the current stock price against the forward PE ratio in 10 years to find out.

Master it! Solution
a. The dividend growth rates, dividends, and stock price are:
Year 1 2 3 4 5 6 7 8 9 10 11
Dividend growth:
Dividend:
Present Value of Dividend
Present Value of Terminal Value (stock price in year 10)
Sum of PV Dividends
PV of TV
Stock Price Today
b. To graph the stock price for different growth rates, we need to calculate the price for various growth rates. Using a one-way data table, we get the following:
Growth rate Stock price
0% Zero Growth Model
1%
2%
3%
4% Constant Growth Model
5%
6%
7%
8%
9%
10%
c. The earnings and price in year 10 will be:
Year 10 PE ratio:
Year 11 earnings:
Year 10 price:
So, the stock price today with this valuation method is:
Price today:
d. Using a one-way data table, the stock price today at different PE ratios is:
PE ratio Stock price
10.00
11.00
12.00
13.00
14.00
15.00
16.00
17.00
18.00
19.00
20.00

In: Finance

Pell Corporation's property, plant, and equipment and accumulated depreciation accounts had the following balances at December...

Pell Corporation's property, plant, and equipment and accumulated depreciation accounts had the following balances at December 31, 2015:

Property, Plant, and
Equipment
Accumulated
Depreciation
Land $350,000 $ —
Land Improvements 180,000 45,000
Building 1,500,000 350,000
Machinery and Equipment 1,158,000 405,000
Automobiles 150,000 112,000

Depreciation method and useful lives:

  • Land improvements: Straight-line; 15 years.
  • Building: 150%-declining-balance; 20 years.
  • Machinery and equipment: Straight-line; 10 years.
  • Automobiles: 150%-declining-balance; 3 years.
  • Depreciation is computed to the nearest month. No salvage values are recognized.

Transactions during 2016:

  1. On January 2, 2016, machinery and equipment were purchased at a total invoice cost of $260,000, which included a $5,500 charge for freight. Installation costs of $27,000 were incurred.
  2. On March 31, 2016, a machine purchased for $58,000 on January 3, 2012, was sold for $36,500.
  3. On May 1, 2016, expenditures of $50,000 were made to repave parking lots at Pell's plant location. The work was necessitated by damage caused by severe winter weather.
  4. On November 2, 2016, Pell acquired a tract of land with an existing building in exchange for 10,000 shares of Pell's $20 par common stock, which had a market price of $38 a share on this date. Pell paid legal fees and title insurance totaling $23,000. The last property tax bill indicated assessed values of $240,000 for land and $60,000 for building. Shortly after acquisition, the building was razed at a cost of $35,000 in anticipation of new building construction in 2017.
  5. On December 31, 2016, Pell purchased a new automobile for $15,250 cash and trade-in of an automobile purchased for $18,000 on January 1, 2015. The new automobile has a cash value of $19,000.

Required:

1. Prepare a schedule analyzing the changes in each of the plant assets during 2016. Disregard the related accumulated depreciation accounts.

PELL CORPORATION
Analysis of Changes in Plant Assets
For the Year Ended December 31, 2016
Balance 12/31/15 Increase Decrease Balance 12/31/16
Land $ $ $
Land improvements
Building
Machinery and equipment
Automobiles
Totals $ $ $ $

Feedback

2. For each asset classification, prepare a schedule showing depreciation expense for the year ended December 31, 2016.

PELL CORPORATION
Depreciation Expense
For the Year Ended December 31, 2016
Land improvements:
Total depreciation on land improvements $
Building:
Total depreciation on building
Machinery and equipment:
Cost of machinery and equipment, Balance, 12/31/15 $
Deduct machine sold 3/31/16 $
Depreciation after applying straight-line rate
Cost of asset purchased 1/2/16 $
Depreciation
Cost of machine sold 3/31/16 $
Depreciation from 1/1/16 to 3/31/16
Total depreciation on machinery and equipment
Automobiles:
Total depreciation on automobiles
Total depreciation expense for 2016 $

Feedback

3. Prepare a schedule showing the gain or loss from each asset disposal that Pell would recognize in its income statement for the year ended December 31, 2016.

PELL CORPORATION
Gain or Loss from Plant Asset Disposals That Would Be Recognized in Income Statement
For the Year Ended December 31, 2016
Gain or (loss)
Sale of machine 3/31/16:
Selling price $
Carrying amount of machine sold
Gain on sale $
Trade-in of automobile 12/31/16:
Carrying amount of trade-in $
Trade-in allowed
Loss on trade-in
Net gain from asset disposals $

In: Accounting

How would you explain the relationship between one's culture and one's identity? What does it mean/look...

How would you explain the relationship between one's culture and one's identity? What does it mean/look like to have a “Christian” identity?

In: Psychology

l... 1.Using the Lewis structure drawing method developed in lecture and lab, complete the following multi-part...

l...
1.Using the Lewis structure drawing method developed in lecture and lab, complete the following multi-part question. Remember to adjust any of your electron counts as required when you do not initially have enough covalent bonds to connect all of your periphery atoms to the central atom. An electron count adjustment should not be done if all you are doing is optimizing an already drawn Lewis structure.

Compound or Ion Name

Chemical Formula

Nitrate Ion

​​​​​​​

ngc e-
valence e-
bonding e-
nonbonding e-


How many covalent bonds do your calculations (with any required adjustments for insufficient covalent bonds) indicate are needed?

How many lone pairs do your calculations (with any required adjustments for insufficient covalent bonds) indicate are needed?

At this point, and in order to answer the rest of the questions, you will actually need to take out a piece of paper and draw a Lewis structure for the formula that was provided.

How many electron groups are associated with the central atom in your Lewis structure?

What is the hybridization state of central atom? ---Select--- sp sp2 sp3 sp3d sp3d2

What is the geometry of the electron groups around the central atom? ---Select--- linear trigonal planar tetrahedral trigonal bipyramidal octahedral

What is the shape of the Lewis structure? ---Select--- linear trigonal planar tetrahedral trigonal bipyramidal octahedral bent trigonal pyramidal see-saw T-shaped square pyramidal square planar

How many lone pairs of electrons are on the central atom?

How many dark wedge bonds are on the central atom?

How many dashed bonds are on the central atom?

What is the formal charge on the central atom? (Use answers like 0,-1,+1,-2,+2, etc.)

2.

Using the Lewis structure drawing method developed in lecture and lab, complete the following multi-part question. Remember to adjust any of your electron counts as required when you do not initially have enough covalent bonds to connect all of your periphery atoms to the central atom. An electron count adjustment should not be done if all you are doing is optimizing an already drawn Lewis structure.

Compound or Ion Name

Chemical Formula

Phosphorus Pentabromide

ngc e-
valence e-
bonding e-
nonbonding e-


How many covalent bonds do your calculations (with any required adjustments for insufficient covalent bonds) indicate are needed?

How many lone pairs do your calculations (with any required adjustments for insufficient covalent bonds) indicate are needed?

At this point, and in order to answer the rest of the questions, you will actually need to take out a piece of paper and draw a Lewis structure for the formula that was provided.

How many electron groups are associated with the central atom in your Lewis structure?

What is the hybridization state of central atom? ---Select--- sp sp2 sp3 sp3d sp3d2

What is the geometry of the electron groups around the central atom? ---Select--- linear trigonal planar tetrahedral trigonal bipyramidal octahedral

What is the shape of the Lewis structure? ---Select--- linear trigonal planar tetrahedral trigonal bipyramidal octahedral bent trigonal pyramidal see-saw T-shaped square pyramidal square planar

How many lone pairs of electrons are on the central atom?

How many dark wedge bonds are on the central atom?

How many dashed bonds are on the central atom?

What is the formal charge on the central atom? (Use answers like 0,-1,+1,-2,+2, etc.)

In: Chemistry

Financial technology, also known as FinTech is an industry composed of companies that use new technology...

Financial technology, also known as FinTech is an industry composed of companies that use new technology and innovation with available resources in order to compete in the marketplace of traditional financial institutions and intermediaries in the delivery of financial services. The recent COVID 19 curfew period in Mauritius saw a huge surge in demand for such services, both for consumer and corporate use, as it helped to perform financial activities without risks of infection.

a) List at least 2 Fintech services that are provided by local companies in Mauritius. (1 mark)

b) List and explain two benefits of each Fintech services mentioned.

c) List and explain two possible drawbacks of each Fintech services mentioned.

d) Will Fintech have a very high adoption of active users in Mauritius by 2021? Debate.

In: Computer Science

how do I solve problem # 10 in chapter 6 of the Essentials of Economics 10th...

how do I solve problem # 10 in chapter 6 of the Essentials of Economics 10th edition by Bradley R. Schiller? DO I need to make 2 graphs?

10. POLICY PERSPECTIVES Suppose that the monthly market demand schedule for Frisbees is

Price $8 $7 $6 $5 $4 $3 $2 $1

Quantity demanded   1,000   2,000   4,000   8,000   16,000   32,000   64,000   150,000
Suppose further that the marginal and average costs of Frisbee production for every competitive firm are
Rate of output Marginal cost: 100 200 300 400 500 600

Marginal cost $2.00 $3.00 $4.00   $5.00 $6.00 $7.00

Average total cost $2.00 $2.50 $3.00   $3.50 $4.00 $4.50

Finally, assume that the equilibrium market price is $6 per Frisbee.   LO5
(a) Draw the cost curves of the typical firm.

(b) Draw the market demand curve and identify market equilibrium.

(c) How many Frisbees are being sold in equilibrium?

(d) How many (identical) firms are initially producing Frisbees?

(e) How much profit is the typical firm making?

(f) In view of the profits being made, more firms will want to get into Frisbee production. In the long run, these new firms will shift the market supply curve to the right and push the price down to minimum average total cost, thereby eliminating profits. At what equilibrium price are all profits eliminated?
(g) How many firms will be producing Frisbees at this price?

In: Economics

Calculate the probabilities below using the following contingency table. Mother's Education Smoked during Pregnancy Didn't Smoke...

  1. Calculate the probabilities below using the following contingency table.

Mother's Education

Smoked during Pregnancy

Didn't Smoke during Pregnancy

Row     Total

Below High School

415

670

1,085

High School

530

1,370

1,900

Some College

131

635

766

College Degree

48

530

578

Column Total

1,124

3,205

4,329

  1. Probability that a mother in the study smoked during the pregnancy.
  2. Probability that a mother smoked during the pregnancy if her education was below high school.
  3. Probability that a mother smoked during pregnancy and had a college degree.
  4. Probability that a mother smoked during pregnancy or that she graduated from college.
  5. Probability that a mother did not smoke during her pregnancy given that she attended some college but did not have a degree.
  6. Probability that a mother with some college smoked during pregnancy.

In: Math

List 2 potential problems associated with the use of genetically engineered agricultural (crop) plants. How successful...

List 2 potential problems associated with the use of genetically engineered agricultural (crop) plants.

How successful has gene therapy been in curing diseases?

In: Biology