For tax purpose an item may be depreciated over a period of several years. With the straight-line method of depreciation, each year the item depreciates by (1/n)th of its original value. With the double-declining-balance method of depreciation, each year the item depreciates by (2/n)ths of its value at the beginning of that year. (In t final year it is depreciated by its value at the beginning of the year). Write a program that perform the following tasks: a) Request a description of the item, the year of purchase, the cost of the item, the number of years to be depreciated (estimated life), and the method of depreciation. b) Display a year-by-year description of the depreciation in a table setting. See Output Examples below: Dutput Examples

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
For tax purposes, an item may be depreciated over a period of several years. With the **straight-line** method of depreciation, each year the item depreciates by \( \frac{1}{n} \)th of its original value. With the **double-declining-balance** method of depreciation, each year the item depreciates by \( \frac{2}{n} \)ths of its value at the beginning of that year. (In the final year, it is depreciated by its value at the beginning of the year). Write a program that performs the following tasks:

a) Request a description of the item, the year of purchase, the cost of the item, the number of years to be depreciated (estimated life), and the method of depreciation.

b) Display a year-by-year description of the depreciation in a table setting. See Output Examples below:

**Output Examples**

```
Enter name of item purchased: computer
Enter year purchased: 2016
Enter cost of item: 2000
Enter estimated life of item (in years): 5
Enter method of depreciation (SL or DDB): SL

Description: computer
Year of purchase: 2016
Cost: $2,000.00
Estimated life: 5 years
Method of depreciation: straight-line

                Value at   Amount Deprec  Total Depreciation
                Beg of Yr  During Year   to End of Year
2016            2,000.00   400.00        400.00
2017            1,600.00   400.00        800.00
2018            1,200.00   400.00        1,200.00
2019            800.00     400.00        1,600.00
2020            400.00     400.00        2,000.00
```

**Explanation of Table**

The output table provides a yearly breakdown of the depreciation process:

- **Value at Beg of Yr**: The item's value at the beginning of the year.
- **Amount Deprec During Year**: The depreciation amount for that year.
- **Total Depreciation to End of Year**: The accumulated depreciation by the end of that year.
Transcribed Image Text:For tax purposes, an item may be depreciated over a period of several years. With the **straight-line** method of depreciation, each year the item depreciates by \( \frac{1}{n} \)th of its original value. With the **double-declining-balance** method of depreciation, each year the item depreciates by \( \frac{2}{n} \)ths of its value at the beginning of that year. (In the final year, it is depreciated by its value at the beginning of the year). Write a program that performs the following tasks: a) Request a description of the item, the year of purchase, the cost of the item, the number of years to be depreciated (estimated life), and the method of depreciation. b) Display a year-by-year description of the depreciation in a table setting. See Output Examples below: **Output Examples** ``` Enter name of item purchased: computer Enter year purchased: 2016 Enter cost of item: 2000 Enter estimated life of item (in years): 5 Enter method of depreciation (SL or DDB): SL Description: computer Year of purchase: 2016 Cost: $2,000.00 Estimated life: 5 years Method of depreciation: straight-line Value at Amount Deprec Total Depreciation Beg of Yr During Year to End of Year 2016 2,000.00 400.00 400.00 2017 1,600.00 400.00 800.00 2018 1,200.00 400.00 1,200.00 2019 800.00 400.00 1,600.00 2020 400.00 400.00 2,000.00 ``` **Explanation of Table** The output table provides a yearly breakdown of the depreciation process: - **Value at Beg of Yr**: The item's value at the beginning of the year. - **Amount Deprec During Year**: The depreciation amount for that year. - **Total Depreciation to End of Year**: The accumulated depreciation by the end of that year.
**ID Number Validation Process**

A website validates a 16-digit ID number based on the following rules:

1. **Doubling Every Other Digit**: 
   - Starting with the leftmost digit, double it and continue with every other digit. If a doubled digit results in a two-digit number, subtract 9 from it. Sum the resulting digits.
   - Example: For the ID number 5866793610024475, considered digits are 5, 6, 7, 3, 1, 0, 4, 7. Their replacements are 1, 3, 5, 6, 2, 0, 8, 5, with a total sum of 30.

   **Table Explanation**:
   - The table shows the index of each digit, the original digits, and the calculations applied.
   - Example calculations are included: 
     - \(5 \times 2 - 9 = 1\)
     - \(6 \times 2 - 9 = 3\)

2. **Sum of Remaining Digits**:
   - Add the digits from the odd-numbered positions.
   - For the example ID above, the sum is \(8 + 6 + 9 + 6 + 0 + 2 + 4 + 5 = 40\).

3. **Validating the Total Sum**:
   - Add the two sums. If the result is a multiple of 10, the ID is valid.
   - In the example, \(30 + 40 = 70\), which is a multiple of 10, thus the ID is valid.

4. **Program Output Example**:
   - When prompted, entering the ID number confirms its validity:
     - "Enter a credit card number: 5866793610024475."
     - "The number, 5866793610024475, is valid."
Transcribed Image Text:**ID Number Validation Process** A website validates a 16-digit ID number based on the following rules: 1. **Doubling Every Other Digit**: - Starting with the leftmost digit, double it and continue with every other digit. If a doubled digit results in a two-digit number, subtract 9 from it. Sum the resulting digits. - Example: For the ID number 5866793610024475, considered digits are 5, 6, 7, 3, 1, 0, 4, 7. Their replacements are 1, 3, 5, 6, 2, 0, 8, 5, with a total sum of 30. **Table Explanation**: - The table shows the index of each digit, the original digits, and the calculations applied. - Example calculations are included: - \(5 \times 2 - 9 = 1\) - \(6 \times 2 - 9 = 3\) 2. **Sum of Remaining Digits**: - Add the digits from the odd-numbered positions. - For the example ID above, the sum is \(8 + 6 + 9 + 6 + 0 + 2 + 4 + 5 = 40\). 3. **Validating the Total Sum**: - Add the two sums. If the result is a multiple of 10, the ID is valid. - In the example, \(30 + 40 = 70\), which is a multiple of 10, thus the ID is valid. 4. **Program Output Example**: - When prompted, entering the ID number confirms its validity: - "Enter a credit card number: 5866793610024475." - "The number, 5866793610024475, is valid."
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 2 images

Blurred answer
Knowledge Booster
Fibonacci algorithm
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education