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

COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
1st Edition
ISBN:9780357392676
Author:FREUND, Steven
Publisher:FREUND, Steven
Chapter4: Financial Functions, Data Tables, And Amortization Schedules
Section: Chapter Questions
Problem 8AYK
icon
Related questions
Question
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 the
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:
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
2016
2017
2018
2019
2020
Value at
Beg of Yr.
2,000.00
1,600.00
1,200.00
800.00
400.00
Amount Deprec
During Year
400.00
400.00
400.00
400.00
400.00
Total Depreciation
to End of Year
400.00
800.00
1,200.00
1,600.00
2,000.00
Transcribed Image Text: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 the 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: 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 2016 2017 2018 2019 2020 Value at Beg of Yr. 2,000.00 1,600.00 1,200.00 800.00 400.00 Amount Deprec During Year 400.00 400.00 400.00 400.00 400.00 Total Depreciation to End of Year 400.00 800.00 1,200.00 1,600.00 2,000.00
A Web site validates a 16-digit ID number based on the following rules -
1. Starting with the leftmost digit, double it and then double every other digit after it. However, if any of the
doubled digits is a two-digit number, subtract 9 from it. Then sum these new digits. For instance, if the ID card
number is 5866793610024475, then the digits considered are 5, 6, 7, 3, 1, 0, 4, 7, their new replacements are 1,
3, 5, 6, 2, 0, 8, 5 and the sum of the replacement is 30.
1
2
3
4
6.
7
8
9
10
11
12
13
14
15
8.
6.
7
9
3
6
1
4
4
7
5
6
7
1
4
7
5*2-9
6*2-9
7*2-9
3*2
1*2
0*2
4*2
7*2-9
=1
=3
=5
=6
=2
=0
=8
=5
2. Sum together the remaining sever digits from the ID card number. That is, the digits in the odd-numbered
positions. With the ID card number above, we obtain 8+6+9+6+0+2+4+5 = 40.
3. Add together the two sums. If the result is a multiple of 10, then accept the ID card number. Otherwise, reject
it. We accept the ID card number since 30+40=70, a multiple of 10.
Write a program that perform data validation on an ID card number. See Output Examples below:
Output Examples
Enter a credit card number: 5866793610024475
The number, 5866793610024475, is valid.
Transcribed Image Text:A Web site validates a 16-digit ID number based on the following rules - 1. Starting with the leftmost digit, double it and then double every other digit after it. However, if any of the doubled digits is a two-digit number, subtract 9 from it. Then sum these new digits. For instance, if the ID card number is 5866793610024475, then the digits considered are 5, 6, 7, 3, 1, 0, 4, 7, their new replacements are 1, 3, 5, 6, 2, 0, 8, 5 and the sum of the replacement is 30. 1 2 3 4 6. 7 8 9 10 11 12 13 14 15 8. 6. 7 9 3 6 1 4 4 7 5 6 7 1 4 7 5*2-9 6*2-9 7*2-9 3*2 1*2 0*2 4*2 7*2-9 =1 =3 =5 =6 =2 =0 =8 =5 2. Sum together the remaining sever digits from the ID card number. That is, the digits in the odd-numbered positions. With the ID card number above, we obtain 8+6+9+6+0+2+4+5 = 40. 3. Add together the two sums. If the result is a multiple of 10, then accept the ID card number. Otherwise, reject it. We accept the ID card number since 30+40=70, a multiple of 10. Write a program that perform data validation on an ID card number. See Output Examples below: Output Examples 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
COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
Computer Science
ISBN:
9780357392676
Author:
FREUND, Steven
Publisher:
CENGAGE L
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
New Perspectives on HTML5, CSS3, and JavaScript
New Perspectives on HTML5, CSS3, and JavaScript
Computer Science
ISBN:
9781305503922
Author:
Patrick M. Carey
Publisher:
Cengage Learning
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781305480537
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT