[SOLVED] CS221 Assignment6-Java’s Lambdas and Streams

30.00 $

Category:
Click Category Button to View Your Next Assignment | Homework

You will receive the following solution file(s) instantly after successful payment:

zip file icon Assignment_6-thv3pr.zip (284.2 KB)
Assignment Instructions Updated Recently? Submit Below and we will provide new Solution!
Submit New Instructions
🔒 Securely Powered by:
Secure Checkout
5/5 - (2 votes)

This assignment focuses on Java’s Lambdas and Streams discussed in Chapter 17 and generic classes discussed in Chapter 20. You will need to implement the four methods declared in the provided Java file.

For     this    assignment,     you     must    use     Java’s     streams     with    intermediate     and     terminal    operations            (e.g.

𝑓𝑖𝑙𝑡𝑒𝑟, 𝑚𝑎𝑝, 𝑙𝑖𝑚𝑖𝑡, 𝑠𝑢𝑚 …). You are not allowed to use any looping structures (i.e. For, While, and Do‐While). For file input, you must use the 𝑗𝑎𝑣𝑎. 𝑛𝑖𝑜 package and not the 𝑗𝑎𝑣𝑎. 𝑖𝑜 package. However, you may use any of the exception classes from 𝑗𝑎𝑣𝑎. 𝑖𝑜 since there aren’t any in 𝑗𝑎𝑣𝑎. 𝑖𝑜!

Consult each method’s Javadoc for a description of that method’s task.

Figures:

   

0
 

50
Figure 1: Sum illustration between 10 and 20 (must account for 0-based indexes)
 

1
 

51
 

2
 

52
 

3
 

53
 

4
 

54
 

5
 

55
 

6
 

56
 

7
 

57
 

8
 

58
 

9
 

59
 

10
 

60
 

11
 

61
 

12
 

62
 

13
 

63
 

14
 

64
 

15
 

65
 

16
 

66
 

17
 

67
 

18
 

68
 

19
 

69
 

20
 

70
 

…
 

…
   
  Ignored Elements Summed Elements

 

Assignment 5 – CSc 221 – CCNY                                                                                                                                                                            1

The City College of New York, CUNY

Department of Compute Science

North Academic Center, Room 8/206

160 Convent Avenue, New York, NY  10031

Dd

 

  1. 𝑇𝑒𝑠𝑡𝑖𝑛𝑔 𝑡𝑜𝑄𝑢𝑒𝑢𝑒 𝑢𝑠𝑖𝑛𝑔 𝑎𝑛 𝑒𝑚𝑝𝑡𝑦 𝑠𝑡𝑎𝑐𝑘. 𝑉𝑎𝑙𝑢𝑒𝑠:

 

  1. 𝑇𝑒𝑠𝑡𝑖𝑛𝑔 𝑡𝑜𝑄𝑢𝑒𝑢𝑒 𝑢𝑠𝑖𝑛𝑔 𝑠𝑡𝑎𝑐𝑘𝐶ℎ𝑎𝑟. 𝑉𝑎𝑙𝑢𝑒𝑠: 𝐴𝐵𝐶𝐷𝐸𝐹𝐺𝐻𝐼𝐽𝐾𝐿𝑀𝑁𝑂𝑃𝑄𝑅𝑆𝑇𝑈𝑉𝑊𝑋𝑌𝑍

 

  1. 𝑇𝑒𝑠𝑡𝑖𝑛𝑔 𝑟𝑒𝑣𝑒𝑟𝑠𝑒𝑆𝑡𝑎𝑐𝑘 𝑢𝑠𝑖𝑛𝑔 𝑠𝑡𝑎𝑐𝑘𝐶ℎ𝑎𝑟. 𝑉𝑎𝑙𝑢𝑒𝑠: 𝑍𝑌𝑋𝑊𝑉𝑈𝑇𝑆𝑅𝑄𝑃𝑂𝑁𝑀𝐿𝐾𝐽𝐼𝐻𝐺𝐹𝐸𝐷𝐶𝐵𝐴
  2. 𝑇𝑒𝑠𝑡𝑖𝑛𝑔 𝑠𝑢𝑚𝐵𝑒𝑡𝑤𝑒𝑒𝑛 𝑢𝑠𝑖𝑛𝑔 𝑠𝑡𝑎𝑐𝑘𝐼𝑛𝑡. 𝑆𝑢𝑚 𝑏𝑒𝑡𝑤𝑒𝑒𝑛 2 𝑎𝑛𝑑 0: 1
  3. 𝑇𝑒𝑠𝑡𝑖𝑛𝑔 𝑠𝑢𝑚𝐵𝑒𝑡𝑤𝑒𝑒𝑛 𝑢𝑠𝑖𝑛𝑔 𝑠𝑡𝑎𝑐𝑘𝐼𝑛𝑡. 𝑆𝑢𝑚 𝑏𝑒𝑡𝑤𝑒𝑒𝑛 10 𝑎𝑛𝑑 20: 704

 

  1. 𝑇𝑒𝑠𝑡𝑖𝑛𝑔 𝑠𝑢𝑚𝐵𝑒𝑡𝑤𝑒𝑒𝑛 𝑢𝑠𝑖𝑛𝑔 𝑠𝑡𝑎𝑐𝑘𝐼𝑛𝑡. 𝑆𝑢𝑚 𝑏𝑒𝑡𝑤𝑒𝑒𝑛 1000 𝑎𝑛𝑑 2000: 1

 

  1. 𝑇𝑒𝑠𝑡𝑖𝑛𝑔 𝑟𝑒𝑎𝑑𝑁𝑢𝑚𝑒𝑟𝑖𝑐𝐹𝑟𝑜𝑚𝐹𝑖𝑙𝑒. 1𝑠𝑡 10 𝑁𝑢𝑚𝑒𝑟𝑖𝑐 𝑐ℎ𝑎𝑟𝑎𝑐𝑡𝑒𝑟𝑠 𝑓𝑜𝑢𝑛𝑑: 7, 4, 6, 9, 6, 8, 6, 1, 3, 2
  • Assignment_6-thv3pr.zip