accesscode-2-1 / unit-0 Goto Github PK
View Code? Open in Web Editor NEWUnit 0 lessons and materials
Unit 0 lessons and materials
Finish your Text based game, using loops and methods.
Finish your Roman Numeral Calculator.
Post a link to your homework GitHub repositories + link to your Medium post as comment to this issue by Friday 3/13 8pm.
Submission format:
1. [Adventure Game](<link to homework repository>) // should be named HW-20150314
2. [Roman Numeral Calculator](<link to homework repository>)
3. [Medium post](<link to Medium post>)
Welcome to HW3! All material used in this HW is located here
Write a function uniqueCharacters which accepts as input a string S. Given the string S return a string S2 which contains all the distinct characters in S. The input string will only contain lowercase characters. The ordering of characters in the output string does not matter. Eg.
You are provided with a Person class. This class has private fields name, phoneNumber and city, along with their getter and setter methods.
The Roman General Julius Caesar used to correspond with his generals using a secret code. He devised a way of encrypting his messages using a simple encryption scheme now known as Caesar Cipher or Shift Cipher. You can read more about it here
You are given 3 classes
Write a program to simulate an election. Create a class called VotingSimulator. In the main method, you are required to do the following:
After submitting your HW, please complete a HW Feedback form
Print a table of size NxN where an entry (i, j) is:
@ character + 1 space character
if i divides j or j divides iFor example:
@ @ @ @ @ @ @ @ @ @ @ @ @ @ @
Write a program which assumes a random integer X in some range, say 1 - 100,000. It prompts you to input a number and responds with the following information:
You can use Java's Math.random() to generate a random number. Note that it returns a double, but we want an int
The Fibonacci Sequence is the series of numbers: 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, ...
Write a program which accepts as input an integer N and returns the N-th Fibonacci number. To test whether your program returned the correct number, go to Wolfram Alpha, and enter fibonacci(N) where N is your input integer
Write a program that calls a method printTitle
that prints a phrase as a title by,
For example,
printTitle("a tale of two cities", '*')
produces
A Tale of Two Cities
* **** ** *** ******
Fork the repo VerbosityCalculator and follow the instructions in the repo
Post a link to your homework GitHub repositories + link to your Medium post as comment to this issue by Friday 3/20 8pm.
Submission format: : Same as last week
Exercise: [optional] Write a method that counts the number of words in a string. For example,
coundWords("Eighty percent of success is showing up.")
returns 7.
Exercise: [optional] Write a method that computes the average word length. To compute the average, count the total number of letters in words (not including spaces) as well as the total number of words, and divide them. Make sure the result is a double, not an int. For example,
averageWordLength("Eighty percent of success is showing up.")
returns about 4.714.
Execise: [optional] Write a method that replaces all occurrences of "man" with "wo/man", "men" with "wo/men", "he" with "s/he", "his", with "his/her", and "him" with "him/her". Feel free to substitute your own preferred gender-neutral nouns and pronouns.
Exercise: [optional] Write a method that reverses a string by order of words (rather than characters). Treat punctuation as part of a word.
For example,
reverseWords("You miss 100% of the shots you don’t take.")
returns
"take. don't you shots the of 100% miss You"
For extra credit, try to preserve sentences by leaving punctuation at the end and fixing capitalization, so that the result is instead,
"Take don't you shots the of 100% miss you."
Welcome to HW4! This homework is due on Friday, 4/3 by 8 pm.
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
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.
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 %
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.
After submitting your HW, please complete a HW Feedback form
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.