Professional Documents
Culture Documents
Capability2 Assignment
Capability2 Assignment
Introduction:
This document covers list of assignments/exercises related to second capability of
Basecamp program:
Use arrays to structure the raw data and to perform data comparison &
operations
Observations:
KO: 1. Ability to work with multi-dimensional array - 1D and 2D arrays (primitive type
arrays)
KO: 2. Ability to work on string operations - search, concatenation, replace characters
3. Ability to manipulate data with the given requirement - modifying, update data in
arrays
KO: 4. Ability to pass array as argument to a method and return an array from a method
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Example:
Input:
Output:
iSumArray[] 30 70 60 70 80
Example
n IsPrime(n)
0 false
1 false
2 true
3 true
4 false
5 true
323 false
337 true
6737626471 true
117342557809 false
Analyze the below code and invoke the method using main method.
4th and 5th characters must be digits and can have values between 0-9
6th and 7th characters must be upper case letters and can have combination any
of following substring: CS, IS,EC and ME
8th,9th and 10th characters must be digits and can have values between 0-9
Create class called TestUSN which has main() method to:
Initialize USN variable with string value
Validate USN against above constraints
Print "Success" or "Failure" message based on result of validation
Input
A String that needs to be compressed is given. Given string always contains characters.
The string may contain characters in upper as well as lower case.
Basecamp Capability 2 Assignments
Output
Output is the compressed string or the same string if the compressed string length is
more than or equal to the length of the original string. Output contains string in
lowercase always.
Input: aAbcccccaaA output: a2b1c5a3
Input: BBBBbbb output: b7
Example:
Basecamp Capability 2 Assignments
Source: https://www.w3resource.com/java-exercises/array/java-array-exercise-39.php
Basecamp Capability 2 Assignments
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Basecamp Capability 2 Assignments
Summary:
You must have learnt:
How to declare and initialize array elements?
How to work with 1D and 2D arrays?
How to handle strings and perform search and other operations?
How to process array elements?
How to pass arguments to a method/functions and return a value?