Browse W
Alphabetical listing with fast deep pagination.
66619 items • Page 1034 / 1333
Write a method named reportBlankLines that accepts a Scanner containing an input
Write a method named reportBlankLines that accepts a Scanner containing an input file as a parameter and that outputs the line numbers of any blank lines and that reports the tota…
Write a method named rotate Right that accepts an array of integers as a paramet
Write a method named rotate Right that accepts an array of integers as a parameter and rotates the values in the array to the right (i.e., forward in position) by one. Each elemen…
Write a method named rowOfStars that takes a single integer parameter n and retu
Write a method named rowOfStars that takes a single integer parameter n and returns a String with that many stars in it. For example, calling the method with a value of 3 would ca…
Write a method named sameDashes that takes two strings as parameters and that re
Write a method named sameDashes that takes two strings as parameters and that returns whether or not they have dashes in the same places (returning true if they do and false other…
Write a method named season that takes two integers as parameters representing a
Write a method named season that takes two integers as parameters representing a month and day and that returns a Stringindicating the season for that month and day. Assume that m…
Write a method named season that takes two integers as parameters representing a
Write a method named season that takes two integers as parameters representing a month and day and that returns a String indicating the season for that month and day. Assume that …
Write a method named sequenceSum that prints terms of the following mathematical
Write a method named sequenceSum that prints terms of the following mathematical sequence: Your method should accept a real number as a parameter representing a limit, and should …
Write a method named showChar. The method should accept two arguments: a referen
Write a method named showChar. The method should accept two arguments: a reference to a String object and an integer. The integer argument is a character position within the Strin…
Write a method named site. This method accepts the Scanner object as its paramet
Write a method named site. This method accepts the Scanner object as its parameter. This method reads a commercial website URL that starts with www and ends with .edu or .com. Thi…
Write a method named stripHtmlTags that accepts a Scanner representing an input
Write a method named stripHtmlTags that accepts a Scanner representing an input file as its parameter, then reads that file, assuming that the file contains an HTML web page, and …
Write a method named stripHtmlTags that accepts a Scanner representing an input
Write a method named stripHtmlTags that accepts a Scanner representing an input file as its parameter, then reads that file, assuming that the file contains an HTML web page, and …
Write a method named stripHtmlTags that accepts a Scanner representing an input
Write a method named stripHtmlTags that accepts a Scanner representing an input file as its parameter, then reads that file, assuming that the file contains an HTML web page, and …
Write a method named swapDigitPairs that accepts an integer n as a parameter and
Write a method named swapDigitPairs that accepts an integer n as a parameter and returns a new integer whose value is similar to n's but with each pair of digits swapped in order.…
Write a method named swapPairs that accepts an array of strings as a parameter a
Write a method named swapPairs that accepts an array of strings as a parameter and switches the order of values in a pairwise fashion. Your method should switch the order of the f…
Write a method named threeHeads that repeatedly flips a coin until three heads i
Write a method named threeHeads that repeatedly flips a coin until three heads in a row are seen. You should use a Random object to give an equal chance to a head or a tail appear…
Write a method named threeHeads that repeatedly flips a coin until three heads i
Write a method named threeHeads that repeatedly flips a coin until three heads in a row are seen. You should use a Random object to give an equal chance to a head or a tail appear…
Write a method named threeHeads that repeatedly flips a coin until three heads i
Write a method named threeHeads that repeatedly flips a coin until three heads in a row are seen. You should use a Random object to give an equal chance to a head or a tail appear…
Write a method named, reverse, which reverses the order of an array\'s elements
Write a method named, reverse, which reverses the order of an array's elements without creating another array. The header for the method, reverse, is: void reverse (int arr[]){...…
Write a method numTWords that takes a String as a parameter and that returns the
Write a method numTWords that takes a String as a parameter and that returns the number of words in the String that start with the letter t (upper or lowercase). By definition, wo…
Write a method padString that accepts two parameters: a String and an integer re
Write a method padString that accepts two parameters: a String and an integer representing a length. The method should pad the parameter string with spaces until its length is the…
Write a method power0f Two that takes an integer argument and prints to the cons
Write a method power0f Two that takes an integer argument and prints to the console what power of 2 the given number is. If the number is not a power of 2. then simply print a mes…
Write a method priceIsRight in JAVA that accepts an array of integers bids and a
Write a method priceIsRight in JAVA that accepts an array of integers bids and an integer price as parameters. The method returns the element in the bids array that is closest in …
Write a method priceIsRight that accepts an array of integers bids and an intege
Write a method priceIsRight that accepts an array of integers bids and an integer price as parameters. The method returns the element in the bids array that is closest in value to…
Write a method printRange that accepts integer parameters x and y and that print
Write a method printRange that accepts integer parameters x and y and that prints the sequential integers between x and y inclusive. The first half should be printed with the grea…
Write a method printShampooInstructions(), with int parameter numCycles, and voi
Write a method printShampooInstructions(), with int parameter numCycles, and void return type. If numCycles is less than 1, print "Too few.". If more than 4, print "Too many.". El…
Write a method printSquares that uses recursive backtracking to find all ways to
Write a method printSquares that uses recursive backtracking to find all ways to express an integer as a sum of squares of unique positive integers. For example, the call of print…
Write a method printTwos that accepts an integer parameter n and that prints an
Write a method printTwos that accepts an integer parameter n and that prints an expression composed of a single odd number multiplied by twos that is equal to n. The twos should s…
Write a method public boolean subString(String str1, String str2) that returns t
Write a method public boolean subString(String str1, String str2) that returns true if stri is a substring of str2. and false otherwise. For example, subString(abc, abcd) returns …
Write a method public static ArrayList merge(ArrayList a, ArrayList b) that merg
Write a method public static ArrayList merge(ArrayList a, ArrayList b) that merges two array lists, alternating elements from both array lists. If one array list is shorter than t…
Write a method public static ArrayList merge(ArrayList a, ArrayList b) that merg
Write a method public static ArrayList merge(ArrayList a, ArrayList b) that merges two array lists, alternating elements from both array lists. If one array list is shorter than t…
Write a method public static int lowestBasePalindrome (int num) that takes a pos
Write a method public static int lowestBasePalindrome (int num) that takes a positive, base-10 integer num as an argument and returns the lowest base greater than or equal to 2 fo…
Write a method public static void transfer (StackX one, StackX two): It transfer
Write a method public static void transfer (StackX one, StackX two): It transfers all elements in the first parameter onto the top of the second parameter, keeping the same order.…
Write a method push_front(Type someItem) that adds someItem to the front of the
Write a method push_front(Type someItem) that adds someItem to the front of the list and pushes the other nodes in the list back. Iterators must be used not just indexes.
Write a method randomWalk that performs a random one-dimensional walk, reporting
Write a method randomWalk that performs a random one-dimensional walk, reporting each position reached and the maximum position reached during the walk. The random walk should beg…
Write a method range that accepts an ArrayList of integers as a parameter and th
Write a method range that accepts an ArrayList of integers as a parameter and that returns the range of values contained in the list, which is defined as 1 more than the differenc…
Write a method rarest that accepts a map whose keys are strings and whose values
Write a method rarest that accepts a map whose keys are strings and whose values are integers as a parameter and returns the integer value that occurs the fewest times in the map.…
Write a method rearrange that takes a queue of integers as a parameter and rearr
Write a method rearrange that takes a queue of integers as a parameter and rearranges the order of the values so that all of the even values appear before the odd values and that …
Write a method removeEvens that removes the values in even-numbered indexes from
Write a method removeEvens that removes the values in even-numbered indexes from a list, returning a new list containing those values in their original order. For example, if a va…
Write a method removeFront that takes an integer n as a parameter and that remov
Write a method removeFront that takes an integer n as a parameter and that removes the first n values from a list of integers. For example, if a variable called list stores this s…
Write a method removeShorterStrings that takes an ArrayList of Strings as a para
Write a method removeShorterStrings that takes an ArrayList of Strings as a parameter and that removes from each successive pair of values the shorter string in the pair. For exam…
Write a method removeShorterStrings that takes an ArrayList of Strings as a para
Write a method removeShorterStrings that takes an ArrayList of Strings as a parameter and that removes from each successive pair of values the shorter string in the pair. For exam…
Write a method removeShorterStrings that takes an ArrayList of Strings as a para
Write a method removeShorterStrings that takes an ArrayList of Strings as a parameter and that removes from each successive pair of values the shorter string in the pair. For exam…
Write a method reorder that takes a queue of integers as a parameter and that pu
Write a method reorder that takes a queue of integers as a parameter and that puts the integers into sorted (nondecreasing) order assuming that the queue is already sorted by abso…
Write a method shift that takes a stack of integers and an integer n as paramete
Write a method shift that takes a stack of integers and an integer n as parameters and that shifts n values from the bottom of the stack to the top of the stack. For example, if a…
Write a method shift that takes a stack of integers and an integer n as paramete
Write a method shift that takes a stack of integers and an integer n as parameters and that shifts n values from the bottom of the stack to the top of the stack. For example, if a…
Write a method so that the main() code below can be replaced by the simpler code
Write a method so that the main() code below can be replaced by the simpler code that calls method mphAndMinutesToMiles(). Original main(): Write a method so that the main) code b…
Write a method so that the main0 code below can be replaced by the simpler code
Write a method so that the main0 code below can be replaced by the simpler code that calls method mphAndMinutes ToMiles0 Original maino: public class CalcMiles public static void …
Write a method speedingTicket that decides whether a given driver should be give
Write a method speedingTicket that decides whether a given driver should be given a speeding ticket from a police officer. The method accepts three parameters: the driver's car sp…
Write a method splitStack that takes a stack of integers as a parameter and spli
Write a method splitStack that takes a stack of integers as a parameter and splits it into negatives and non-negatives. The numbers in the stack should be rearranged so that all t…
Write a method splitStack that takes a stack of integers as a parameter and spli
Write a method splitStack that takes a stack of integers as a parameter and splits it into negatives and non-negatives. The numbers in the stack should be rearranged so that all t…