Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HW due 4/3 #6

Open
asaini opened this issue Mar 28, 2015 · 38 comments
Open

HW due 4/3 #6

asaini opened this issue Mar 28, 2015 · 38 comments

Comments

@asaini
Copy link
Contributor

asaini commented Mar 28, 2015

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
Copy link

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
Copy link

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
Copy link
Contributor Author

asaini commented Mar 30, 2015

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
Copy link

HW//will add medium post on friday

@sufeiiz
Copy link

sufeiiz commented Apr 2, 2015

  1. Homework
  2. April Fools

@Yuliya-Kaleda
Copy link
Contributor

@tashsmit
Copy link

tashsmit commented Apr 3, 2015

@ramonaharrison
Copy link

  1. HW
  2. Blog Post

@AnthonyFermin
Copy link

  1. Homework
  2. Medium

@hyunj0
Copy link

hyunj0 commented Apr 3, 2015

HW_04-03 New Repo
Medium

@ahhhlvin
Copy link
Contributor

ahhhlvin commented Apr 3, 2015

Homework
Medium Post

@poojawins
Copy link

Homework

@hanzchoi
Copy link

hanzchoi commented Apr 3, 2015

1.Linear Search on ArrayList
2. Medium

@theaulait
Copy link

  1. Homework
  2. Medium

@jaellys
Copy link

jaellys commented Apr 3, 2015

  1. Homework
  2. Medium post incoming.

@JLWork3
Copy link

JLWork3 commented Apr 3, 2015

Homework
Medium post

@alizinha
Copy link

alizinha commented Apr 3, 2015

  1. Homework.
  2. Medium.com post: "My First-Ever Code Review!"

@hoshikoo
Copy link

hoshikoo commented Apr 3, 2015

  1. Homework
  2. Medium Post

@MadelynTav
Copy link

  1. Homework
  2. Medium

@m47bell
Copy link

m47bell commented Apr 3, 2015

  1. Homework
  2. Medium

@charlyn23
Copy link

  1. [Homework](link to homework repository)

@KMaragh
Copy link

KMaragh commented Apr 3, 2015

Homework
Medium Post - Just updated it

@Amcbri15
Copy link

Amcbri15 commented Apr 4, 2015

@lighterletter
Copy link

HomeWork
Medium

@abassawo
Copy link

abassawo commented Apr 4, 2015

Homework
Medium Post

@jvvlives2005
Copy link

  1. Homework
  2. Medium

@ReinardCox
Copy link

@RosmaryFC
Copy link

Homework

@lukesterlee
Copy link
Contributor

  1. Homework

@hanzchoi
Copy link

hanzchoi commented Apr 4, 2015

3.Sanitizing web pages

@annalinewyork
Copy link

HW
Medium

@hanzchoi
Copy link

4.Character Distributions

@jorgereina1986
Copy link

Homework
Medium

@jgarcia162
Copy link

Homework

@MadelynTav
Copy link

Medium

@lighterletter
Copy link

*Finished Distribution Calculator. Hw

@rayacevedo45
Copy link

HW

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests