accesscode-2-1 / unit-0

Unit 0 lessons and materials
5 stars 8 forks source link

HW due 4/3 #6

Open asaini opened 9 years ago

asaini commented 9 years ago

Welcome to HW4! This homework is due on Friday, 4/3 by 8 pm.

1. Linear Search on ArrayList

You are given an ArrayList of unknown size containing integers. Write a class called LinearSearch which implements a static method search which accepts as input an ArrayList alist and an integer x, and returns the first index it sees of x in alist. If the integer is not present return in the list return -1

Eg. if arraylist contains: [3, 45, 1, 2, 99] and x = 1
Returns : 2

2. Sanitizing web pages

Search engines like Google have programs called web-scapers which visit webpages and scrape the information displayed on the webpage. The displayable information is contained in html tags like p, table, h2 etc. When we make a GET request for a webpage, the HTML that is returned can also contain tags like script which often do not correspond to the displayable content on the webpage. Information inside script tags is not used by scapers and they often ignore these tags in the HTML. Write a class called WebPageSanitizer which implements a static method called String sanitize(String html) which removes all script tags and the information that they encapsulate and returns a sanitized version of the HTML string.

3. Character Distributions

Create a class to calculate the distribution of characters in the contents of a text file. Your class called DistributionCalculator should implement a method calculate(File textFile) which accepts as input a Text file. It reads the contents of the file and returns an ArrayList which contains the distribution/percentage of characters (a-z) in the text file. You should lowercase lines before you do the calculation. Call the calculate method from main and print the distribution. You can ignore characters which do not belong in the range(a-z) for doing your calculation. Your program's output should look something like:

a = 14.44 %
b = 6.02 %
...
...
z = 0.05 %

4. Bonus/Challenge : Project Euler

Project Euler is a website dedicated to a series of computational problems intended to be solved with computer programs. The project attracts adults and students interested in mathematics and computer programming.
As an exercise, we are asking you to solve one of Project Euler's problems described here. Create a class called LettersInNumbers which has a method letterCount which returns an integer containing the number of letters.

5. Weekly Requirements

After submitting your HW, please complete a HW Feedback form

tashsmit commented 9 years ago

Hello Asaini! for HW problem 1, how are we getting the ArrayList? Should we pass that through the method parameter as well as the integer x?

ramonaharrison commented 9 years ago

Hi Asaini, I also have a question :) I'm wondering about problem #3, where it says "You can ignore characters which do not belong in the range(a-z)"... does this mean we should ignore the uppercase variants of those characters (A-Z), or would you prefer that we account for all alphabetic characters in the text?

asaini commented 9 years ago

Hi tashsmit & ramonaharrison,

I've updated the descriptions for Problems 1 & 3.

Problem 1 : You are required to pass the ArrayList as a parameter to the search method . Problem 3 : You should lowercase everything before you do the computation, so uppercase characters get accounted.

Thanks

fattyduck commented 9 years ago

HW//will add medium post on friday

sufeiiz commented 9 years ago
  1. Homework
  2. April Fools
Yuliya-Kaleda commented 9 years ago
  1. Homework Exercises
  2. Calendar
  3. Look Like Twins but Function Differently
tashsmit commented 9 years ago
  1. Bonus Problem
  2. HW Exercises
  3. Dissecting the Java Calendar Class
ramonaharrison commented 9 years ago
  1. HW
  2. Blog Post
AnthonyFermin commented 9 years ago
  1. Homework
  2. Medium
hyunj0 commented 9 years ago

HW_04-03 New Repo Medium

ahhhlvin commented 9 years ago

Homework Medium Post

poojawins commented 9 years ago

Homework

hanzchoi commented 9 years ago

1.Linear Search on ArrayList

  1. Medium
theaulait commented 9 years ago
  1. Homework
  2. Medium
jaellys commented 9 years ago
  1. Homework
  2. Medium post incoming.
JLWork3 commented 9 years ago

Homework [Medium post]()

alizinha commented 9 years ago
  1. Homework.
  2. Medium.com post: "My First-Ever Code Review!"
hoshikoo commented 9 years ago
  1. Homework
  2. Medium Post
MadelynTav commented 9 years ago
  1. Homework
  2. Medium
m47bell commented 9 years ago
  1. Homework
  2. Medium
charlyn23 commented 9 years ago
  1. [Homework](link to homework repository)
KMaragh commented 9 years ago

Homework Medium Post - Just updated it

Amcbri15 commented 9 years ago

Homework Calendar from TeamAnthony Medium Post

lighterletter commented 9 years ago

HomeWork Medium

GMSyrimis commented 9 years ago

https://medium.com/@gmsyrimis/solve-the-problem-once-a6b93519a3e https://github.com/GMSyrimis/HW_04_03

abassawo commented 9 years ago

Homework Medium Post

jvvlives2005 commented 9 years ago
  1. Homework
  2. Medium
ReinardCox commented 9 years ago
  1. Homework
  2. Medium (https://medium.com/@Reinard_Cox/my-first-medium-post-d621a82f1316)
RosmaryFC commented 9 years ago

Homework

lukesterlee commented 9 years ago
  1. Homework
hanzchoi commented 9 years ago

3.Sanitizing web pages

annalinewyork commented 9 years ago

HW Medium

hanzchoi commented 9 years ago

4.Character Distributions

jorgereina1986 commented 9 years ago

Homework Medium

jgarcia162 commented 9 years ago

Homework

MadelynTav commented 9 years ago

Medium

lighterletter commented 9 years ago

*Finished Distribution Calculator. Hw

rayacevedo45 commented 9 years ago

HW