Questions
Write a Python code that will ask a user to input a year and return "Leap...

Write a Python code that will ask a user to input a year and return "Leap Year" if the year is a leap year, or "No Leap Year" if it is not a leap year. The program then asks for another year and performs the same task in the form of a loop, until the user inputs the then integer "-1." At that point, the program will exit the loop.

In: Computer Science

C++ problem 11-2 In this chapter, the class dateType was designed to implement the date in...

C++ problem 11-2

In this chapter, the class dateType was designed to implement the date in a program, but the member function setDate and the constructor do not check whether the date is valid before storing the date in the member variables. Rewrite the definitions of the function setDate and the constructor so that the values for the month, day, and year are checked before storing the date into the member variables. Add a member function, isLeapYear, to check whether a year is a leap year. Moreover, write a test program to test your class.

Input should be format month day year with each separated by a space.

for dateType.h

//dateType.h

#ifndef date_H

#define date_H

class dateType

{

public:

    void setDate(int month, int day, int year);

      int getDay() const;

      int getMonth() const;

    int getYear() const;

    void printDate() const;

    bool isLeapYear();

dateType(int month = 1, int day = 1, int year = 1900);

private:

int dMonth;      

    int dDay;        

    int dYear;       

};

#endif

---------------------------------------

For dateTypeImp.cpp

#include"dateType.h"

class dateType{

   private:

   int month;

   int day;

   int year;

  

    public:

   

   dateType(){

   }

   

   dateType(int month,int day,int year){

       int maxNumberOfDays[]={31,28,31,30,31,30,31,31,30,31,30,31};

       if(month < 1 || month > 12){

           cout<<"Date :"<<month<<"-"<<day<<"-"<<year;

           cout<<" Month is not valid"<<endl;

       }

       if(day >= 1 && day <= maxNumberOfDays[month]){

       }

       

       else if(month == 2 && day == 29){

           if(isLeapYear() == 1){

              

           }

           else{

               cout<<"Date :"<<month<<"-"<<day<<"-"<<year;

               cout<<" Day is not valid for this month"<<endl;

           }

       }

       else{

           cout<<"Date :"<<month<<"-"<<day<<"-"<<year;

           cout<<" Day is not valid for this month"<<endl;

       }

       if(year < 0){

           cout<<"Date :"<<month<<"-"<<day<<"-"<<year;

           cout<<" year is not valid"<<endl;

       }

       this->month = month;

       this->day = day;

       this->year = year;

   }

   int isLeapYear(){

       int year = this->year;

       

       if((year % 400) == 0){

           return 1;

       }

      

      

       else if((year % 100) == 0){

           return 0;

       }

       else if((year%4) == 0)

           return 1;

       // else

       return 0;

   }

   void setDate(int month,int day,int year){

       

       int maxNumberOfDays[]={31,28,31,30,31,30,31,31,30,31,30,31};

      

       

       if(month < 1 || month > 12){

           cout<<"Date :"<<month<<"-"<<day<<"-"<<year;

           cout<<" Month is not valid"<<endl;

       }

       

       if(day >= 1 && day <= maxNumberOfDays[month]){

       }

       

       else if(month == 2 && day == 29){

           if(isLeapYear() == 1){

               

           }

           else{

               cout<<"Date :"<<month<<"-"<<day<<"-"<<year;

               cout<<" Day is not valid for this month"<<endl;

           }

       }

       else{

           cout<<"Date :"<<month<<"-"<<day<<"-"<<year;

           cout<<" Day is not valid for month="<<month<<endl;

       }

       if(year < 0){

           cout<<"Date :"<<month<<"-"<<day<<"-"<<year;

           cout<<" year is not valid"<<endl;

       }

       this->month = month;

       this->day = day;

       this->year = year;  

   }

   string getDate(){

       return (to_string(this->month)+"-"+to_string(this->day)+"-"+to_string(this->year));

   }

};

--------------------------------------------------------

for main.cpp

#include"dateTypeImp.cpp"

int main(){

   int month;

   int day;

   int year;

   cin>>month>>day>>year;

   dateType Date1(month,day,year);

  

   cout<<"Date 1:"<<Date1.getDate();

   int isLeap = Date1.isLeapYear();

   if(isLeap == 1){

       cout<<" this is a Leap Year"<<endl;

   }

   else{

       cout<<" this is not a Leap Year"<<endl;

   }

   cin>>month>>day>>year;

   dateType Date2;

   Date2.setDate(month,day,year);

   cout<<"Date 2:"<<Date2.getDate();

   isLeap = Date2.isLeapYear();

   if(isLeap == 1){

       cout<<" this is a Leap Year"<<endl;

   }

   else{

       cout<<" this is not a Leap Year"<<endl;

   }

   cin>>month>>day>>year;

   dateType Date3(month,day,year);

   cin>>month>>day>>year;

   dateType Date4;

   Date4.setDate(month,day,year);

  

   cin>>month>>day>>year;

   dateType Date5(month,day,year);

  

   return 0;

}

In: Computer Science

A firm is considering an investment project with the following cash flows: Year 0 = -$110,000...

A firm is considering an investment project with the following cash flows: Year 0 = -$110,000 (initial costs); Year 1= $40,000; Year 2 =$90,000; and Year 3 = $30,000; and Year 4 = $60,000. The company has a 10% cost of capital. What is the project’s discounted payback?

1.67 years

1.86 years

1.99 years

2.08 years

A firm is considering an investment project with the following cash flows: Year 0 = -$110,000 (initial costs); Year 1= $40,000; Year 2 =$90,000; and Year 3 = $30,000; and Year 4 = $60,000. The company has a 10% cost of capital, calculate the NPV for the project.

$58,569

$64,264

$74,264

$77,333

A firm is considering an investment project with the following cash flows: Year 0 = -$110,000 (initial costs); Year 1= $40,000; Year 2 =$90,000; and Year 3 = $30,000; and Year 4 = $60,000. The company has a 10% cost of capital, calculate the IRR for the project.

25.9%

29.8%

34.6%

40.7%

In: Finance

What is the present value of the following cash flow stream at a rate of 3.0%...

What is the present value of the following cash flow stream at a rate of 3.0% per year? Year 0: $0, Year 1: $75, Year 2: $225, Year 3: $0, Year 4: $300

In: Finance

You intended to buy new equipment for $2,000,000, you will depreciate it in value using MACRS...

You intended to buy new equipment for $2,000,000, you will depreciate it in value using MACRS depreciation for a 5-year property. The equipment will then be leased to a friend for $500,000 per year for 4 years. After 4 years, it will be sold to your friend for $700,000.

5-year MACRS schedule:

year 1 = 20%

year 2 = 32%

year 3 = 19.2%

year 4 = 11.52%

year 5 = 11.52%

year 6 = 5.76%

a) what is the book value of the equipment in year 3

b) what, if any, is the recaptured depreciation in year 4

c) is the tax rate is 40% what are the taxes paid in year 4 for the purchase and lease of the equipment

d) will you buy the equipment if it has a MARR of 12%

In: Economics

You are trying to value an option on DMH (Ducati). The stock price is currently $70....

You are trying to value an option on DMH (Ducati). The stock price is currently $70. Next year the stock price will either increase or decrease by $10. The following year the stock price will either increase or decrease (from the year 1 value) by $5. One-year U.S. treasuries currently have an annual return of 4%. Assume that at a one-year U.S. treasury bought in year 1 (maturing in year 2) will have a one-year return of 5%. a. What is the value on a two-year European put option with a strike price of $78? b. What is the value of a two-year American put option with a strike price of $78 (assume you can only exercise at year 1 or year 2, not today)?

In: Finance

Depreciation by Three Methods; Partial Years Perdue Company purchased equipment on April 1 for $64,260. The...

Depreciation by Three Methods; Partial Years

Perdue Company purchased equipment on April 1 for $64,260. The equipment was expected to have a useful life of three years, or 5,940 operating hours, and a residual value of $1,890. The equipment was used for 1,100 hours during Year 1, 2,100 hours in Year 2, 1,800 hours in Year 3, and 940 hours in Year 4.

Required:

Determine the amount of depreciation expense for the years ended December 31, Year 1, Year 2, Year 3, and Year 4, by (a) the straight-line method, (b) units-of-activity method, and (c) the double-declining-balance method.

Note: FOR DECLINING BALANCE ONLY, round the multiplier to four decimal places. Then round the answer for each year to the nearest whole dollar.

a. Straight-line method

Year Amount
Year 1 $
Year 2 $
Year 3 $
Year 4 $

b. Units-of-activity method

Year Amount
Year 1 $
Year 2 $
Year 3 $
Year 4 $

c. Double-declining-balance method

Year Amount
Year 1 $
Year 2 $
Year 3 $
Year 4 $

Feedback

a. Asset cost minus residual value equals depreciable cost. Sum the yearly depreciation to determine total depreciation.

b. Annual units-of-activity depreciation allocates the cost of the asset equally over the units produced (hours).

c. The double-declining rate is two times the straight-line rate. Book value is the asset cost minus accumulated depreciation.

Compare the total depreciation for all methods over the time period. Recall that straight-line depreciation allocates the depreciable cost of the asset equally over the period of use, while double-declining method is an accelerated method.

In: Accounting

1A) What is the discount rate at which the following cash flows have a NPV of...

1A) What is the discount rate at which the following cash flows have a NPV of $0? Answer in %, rounding to 2 decimals.

Year 0 cash flow = -149,000
Year 1 cash flow = 39,000
Year 2 cash flow = 30,000
Year 3 cash flow = 40,000
Year 4 cash flow = 30,000
Year 5 cash flow = 41,000
Year 6 cash flow = 37,000

1B) What is the discounted payback period on Versace's proposed investment in a new line of fashion clothes? The expected cash flows appear below. Note that year 0 and year 1 cash flows are negative. (Answer in years; round to 2 decimals)

Year 0 cash flow = -95,000
Year 1 cash flow = -18,000
Year 2 cash flow = 50,000
Year 3 cash flow = 49,000
Year 4 cash flow = 54,000
Year 5 cash flow = 45,000
Year 6 cash flow = 46,000


Required rate of return = 14.00%

1C) US Robotics is evaluating a new product line. The CFO asks for an estimate of number of years to recover the initial investment, ignoring the time value of money. You realize that this is the payback period. The estimated cash flows from the new product line appear below. (Answer in years, round to 2 places)

Year 0 cash flow = -82,000
Year 1 cash flow = -41,000
Year 2 cash flow = 24,000
Year 3 cash flow = 40,000
Year 4 cash flow = 22,000
Year 5 cash flow = 26,000
Year 6 cash flow = 36,000
Year 7 cash flow = 39,000

ANSWER EACH PART (A,B,C)

In: Finance

Morris Inc. recorded the following transactions over the life of a piece of equipment purchased in...

Morris Inc. recorded the following transactions over the life of a piece of equipment purchased in Year 1:

Jan. 1, Year 1 Purchased equipment for $101,000 cash. The equipment was estimated to have a five-year life and $4,000 salvage value and was to be depreciated using the straight-line method.
Dec. 31, Year 1 Recorded depreciation expense for Year 1.
Sept. 30, Year 2 Undertook routine repairs costing $900.
Dec. 31, Year 2 Recorded depreciation expense for Year 2.
Jan. 1, Year 3 Made an adjustment costing $3,600 to the equipment. It improved the quality of the output but did not affect the life and salvage value estimates.
Dec. 31, Year 3 Recorded depreciation expense for Year 3.
June. 1, Year 4 Incurred $1,950 cost to oil and clean the equipment.
Dec. 31, Year 4 Recorded depreciation expense for Year 4.
Jan. 1, Year 5 Had the equipment completely overhauled at a cost of $11,200. The overhaul was estimated to extend the total life to seven years. The salvage value did not change.
Dec. 31, Year 5 Recorded depreciation expense for Year 5.
Oct. 1, Year 6

Received and accepted an offer of $30,000 for the equipment.

Required: Prepare the journal entry for the disposal of the equipment on October 1, Year 6.

In: Accounting

Explanation textbox: Finishing Hurdle Rate: 16% Original Cost: $    (1,600,000) Net Cash Inflows: Year 1 $       ...

Explanation textbox:
Finishing
Hurdle Rate: 16%
Original Cost: $    (1,600,000)
Net Cash Inflows:
Year 1 $        345,000
Year 2            495,000
Year 3            365,000
Year 4            275,000
Year 5            329,000
Year 6            429,000
Year 7            329,000
Year 8            279,000
Payback period:
Internal Rate of Return:
Net Present Value:
   
Explanation textbox:

In: Accounting