Code along with Juan's example and implement the Video
class that does the following:
- Stores the following data using information...
Code along with Juan's example and implement the Video
class that does the following:
Given an integer representing the radius of a sphere, compute and return the sphere's volume based on the following formula:
Volume = 4/3...
Complete the following function. When given aString, return True if it ends in "ly". Return False otherwise.
Complete the following function. Given aString, return the first half of characters in that string (the string "woohoo" yields "woo")....
Complete the following function. Given aString, return a copy of aString where any character next to a star (*) and all stars themselves...
Given an outside string of length 4, such as "(())"
, and an inside string, return a new string where the inside is squeezed in the middle...
Write a function in Python that implements the following logic: Given 2 int values a and b greater than 0, return whichever value is...
Write a function in Python that implements the following logic: The squirrels in Palo Alto spend most of the day playing. In particular,...
You have a green lottery ticket with three integers: a, b, and c. If all of the numbers are different on it, return 0. If two of the...
You have a green lottery ticket with three integers: a, b, and c. If all of the numbers are different on it, return 0. If two of the...
You have been given several good and bad versions of an 'isPrime()' function.
Write out some tests which will catch the buggy versions,...
You need some way to reverse the lookup process of some python dictionaries. While searching for a key in a dictionary is very fast,...
The forestry department needs help updating some old records of special trees in a nature preserve. They will give you a record of a...
Define a class called Backpack
. The Backpack class should have a initializer method (aka constructor) which creates two instance...
The method skeleton below takes in an integer variable top
.
Using a while
loop, write a method that will return the sum of all numbers...
The method skeleton below takes in an integer variable top
.
Using a for
loop, write a method that will return the sum of all numbers from...
At the heart of test-driven development is writing ___.
Consider a linear search as shown below.
int linearSearch(int w, int[] num) { // linear search code here }
Assume you call this method...
Binary search is a more efficient search than linear search. Which one of these is true?
What is wrong with this code?
String x; if (x.length() > 0) System.out.println("Hello "+x);
What does this code do?
int nums[] = {}; System.out.println(nums.length);
Write a method replaceSpaceUnderscore
that replaces all spaces with _
(underscores) in the String sentence
.
Complete the method countTimesContains
that returns the number of times the array words
contains the word stored in searchW
. Remember to...
Write a method searchInLastN
that implements a linear search but only looks for values in the last positions, determined by the parameter...
Railroad diagrams, also known as syntax diagrams, are a visual way to represent the grammar of a programming language. To use it, you...