. Create class representing a book, assume that this book has, title, author edition. Include all constractors, mutator and accessor methods. This class should override both toString() and equals() methods
Create three arrays of type double. Do a compile-time initialization and place different values in two of the arrays. Write a program to store the product of the two arrays in the third array. Produce a display using the Message Box class that shows the contents of all three arrays using a single line for an element from all three arrays. For an added challenge, design your solution so that the two original arrays have a different number of elements. Use 1 as the multiplier when you produce the third array.
Given an array A of N integers and two integers X and Y, find the number of integers in the array that are both less than or equal to X and divisible by Y.
Exercise 6.4.
A number, a, is a power of b if it is divisible by b and a/b is a power of b. Write a function called is_power that takes parameters a and b and returns True if a is a power of b. Note: you will have to think about the base case.
After writing your is_power function, include the following test cases in your script to exercise the function and print the results:
print("is_power(10, 2) returns: ", is_power(10, 2))
print("is_power(27, 3) returns: ", is_power(27, 3))
print("is_power(1, 1) returns: ", is_power(1, 1))
print("is_power(10, 1) returns: ", is_power(10, 1))
print("is_power(3, 3) returns: ", is_power(3, 3))
Write a function to take the Celsius value as an argument and return the corresponding Fahrenheit value.
Write a java program using two-dimensional arrays that determines the ODD numbers among the 12 input values typed from the keyboard and prints the list of these ODD numbers.
N a country of zombies each city has a certain percentage of zombies. Cities are designated as 1....
n a country of zombies each city has a certain percentage of zombies. Cities are designated as
1. A city[i] is magical if city[i] and city[i+1] have no common divisor other than 1.
2. A city is good if the percentage of zombies in the city[i] is more than percentage of zombies in city[i+1]
Find a city that is perfect, where perfect means both good and magical,
if there are more than one perfect cities, output the left-most city index. Also, the minimum number of cities in a country is 2 and there will be at least one perfect city
Input Specification:
input1: An array representing the percentage of zombies in each city
input2: Number of cities in the country
Output Specification:
Return the favourable city index "i
2 dimentional arrays that determines the odd number among 12 inputs
Write a program to print the following,
Input
The first line contains a string representing a scrambled word.
The second line contains some space-separated strings representing words guessed by the player.
Output
The output should be a single integer of the final score.
Explanation
scramble word = "tacren"
guessed words = ["trance", "recant"]
Since "trance" and "recant" both have length 6 then you score 54 pts each.
So the output is 108.
Sample Input1
tacren
trance recant
Sample Output1
108
Sample Input2
rceast
cat create sat
Sample Output2
2
Write a program to print the following, Given a word W and pattern P, you need to check whether the pattern matches the given word.The word will only contain letters(can be Uppercase and Lowercase). The pattern can contain letters, ? and *.
? : Can be matched with any single letter.
* : Can be matched with any sequence of letters (including an empty sequence).If the pattern matches with the given word, print True else False.
Sample Input1
3
Hello *l?
Hell He?ll
Hell ?*
Sample Output1
True
False
True
Sample Input2
3
Hello Hell*
Hell He*ll
Hell hell*
Sample Output2
True
True
False