Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit

CS 101: Intro to Computer Science

Homework Extra   [30 Marks]

This assignment consists of 4 Coding Challenges.

You can find the challenge on the below Website :

https://cims.nyu.edu/~kapp/cs101/arrayders/

 

You will have to complete the Challenges 1, Challenge 2 & Challenge 3 before

unlocking the Final Challenge.

These challenges are based upon Arrays and need to be solved using Java.        Once you successfully complete a challenge you will get a pass key which           needs to be used to unlock the Final Challenge. The details and hints for each of

the challenges have been provided below.

Challenge 1 : [5 Marks]

 

Find the below hints which would help you out for solving this challenge :

●   To calculate the sum and average of all numbers in the list, the entire list needs to be copied to the Console.

●   Your program should be able to read the inputs from the Console and should be able to convert to a proper Integer Array.

●   To achieve this, you can use the method scanner.nextLine() to read the   entire input from the line at once. However, this will return an entire String.

●   You’ll have to convert this String Object to an Array of String. This can be done using the split(“,”) method of String Class, which will return an        Array Of Strings where every element is a number (whose type is still       String).

●   Each of the elements of Array can be converted to Integer using the         following Integer.parseInt() method with combination of trim() method to ensure that there are no leading and trailing spaces.

●   The above steps can be illustrated as below :

Use the above hints to solve the first Challenge.

Challenge 2 : [7 Marks]

 

Find the below hints which would help you out for solving this challenge :

●   The same input method can be followed in this challenge as well.

●   As Integer will not work here, you might use the Double.parseDouble() method instead of Integer.parseInt().

●   This challenge mentions the use of EVEN positions of Array. EVEN   position means that the index of the element is EVEN. For example : The Number present at the beginning of an Array has index 0. This    means that the position of the element is 0.

●   The Word for the position pointed by the Front of the Amulet Point starts with P.

Final Challenge: [10 Marks]

 

Find the below hints which would help you out for solving this challenge :

   Converting a char to int : You can convert an char exampleChar to int

exampleInt as follows :

 

   Converting an int to char : An Integer exampleInt can be converted to

exampleChar of type char as follows :

 

●   You can use the same methods for parsing as described in Challenge 1.

Submission Details :

●   The Code needs to be submitted on Gradescope.

●   Create 4 .java files named as below :

○   Challenge1.java

○   Challenge2.java

○   Challenge3.java

○   Challenge4.java

●   Zip all of these files to a common file : FirstName_LastName_netID.zip (Devesh_Devendra_dd3053.zip)

●   Submit the zip file on the Coding Assignment on the following Assignment on GradeScope : Extra Homework - Programming Assignment