Programming



Item Name

A palindrome is a sequence of characters that reads the

A palindrome is a sequence of characters that reads the same backward as forward. For example, each of the following five-digit integers is a palindrome: 12321, 55555, 45554 and 11611. Write an application that reads in a five-digit integer and determines whether it’s a palindrome. If the number is not five digits long, display an error message and allow the user to enter a new value.

A palindrome is a string that is spelled the same

A palindrome is a string that is spelled the same way forward and backward. Some examples of palindromes are “radar,” “able was i ere i saw elba” and (if spaces are ignored) “a man a plan a canal panama.” Write a recursive method testPalindrome that returns boolean value true if the string stored in the array is a palindrome and false otherwise. The method should ignore spaces and...

A palindrome is a word or phrase that reads the

A palindrome is a word or phrase that reads the same forward and backward, ignoring blanks and considering uppercase and lowercase versions of the same letter to be equal. For example, the following are palindromes: • warts n straw • radar • Able was I ere I saw Elba • xyzczyx Write a program that will accept a sequence of characters terminated by a period and will decide whether the...

A palindromic prime is a prime number and also palindromic.

A palindromic prime is a prime number and also palindromic. For example, 131 is a prime and also a palindromic prime. So are 313 and 757. Write a program that displays the first 100 palindromic prime numbers. Display 10 numbers per line and align the numbers properly, as follows: 2 3 5 7 11 101 131 151 181 191 313 353 373 383 727 757 787 797 919 929 ...

A palindromic prime is a prime number that is also

A palindromic prime is a prime number that is also palindromic. For example, 131 is a prime and also a palindromic prime, as are 313 and 757. Write a program that displays the first 100 palindromic prime numbers. Display 10 numbers per line and align the numbers properly, as follows: 2 3 5 7 11 101 131 151 181 191 313 353 373 383 727 757 787 797 919 929

A parking garage charges a $2.00 minimum fee to park

A parking garage charges a $2.00 minimum fee to park for up to three hours. The garage charges an additional $0.50 per hour for each hour or part thereof in excess of three hours. The maximum charge for any given 24-hour period is $10.00. Assume that no car parks for longer than 24 hours at a time. Write an application that calculates and displays the parking charges for each customer who parked...

A pentagonal number is defined as n(3n - 1)/2 for

A pentagonal number is defined as n(3n - 1)/2 for n = 1, 2, …, and so on. So, the first few numbers are 1, 5, 12, 22, .... Write a function with the following header that returns a pentagonal number: def getPentagonalNumber(n): Write a test program that uses this function to display the first 100 pentagonal numbers with 10 numbers on each line.

A pentagonal number is defined as n(3n-1)/2 for n= 1,2,…,

A pentagonal number is defined as n(3n-1)/2 for n= 1,2,…, and so on. So, the first few numbers are 1,5,12,22,…..Write the following method that returns a pentagonal number: public static int getPentagonalNumber(int n) Write a test program that displays the first 100 pentagonal numbers with 10 numbers on each line.

A perfect number is a positive integer that is equal

A perfect number is a positive integer that is equal to the sum of its proper divisors. A proper divisor is a positive integer other than the number itself that divides the number evenly (i.e., no remainder). For example, 6 is a perfect number because the sum of its proper divisors 1, 2, and 3 is equal to 6. Eight is not a perfect number because 1 + 2 + 4 ≠ 8. Write a program that accepts a...

A permutation is an ordered subset of a set. For example, say you wanted

A permutation is an ordered subset of a set. For example, say you wanted to pick a combination to a vault. There are 60 possible numbers, and you need three different numbers for the combination. There are p(60,3) permutations for the combination, where P is defined by the formula where! is used as a suffix factorial operator. For example, 4! is 4*3*2*1 . Combinations are similar to permutations,...