Create a Java program to find which word has the maximum occurrence and
replace that word by a special symbol, say *.
Using a procedural approach, write a program that prompts the user to input a number between 0 and 35. If the number is less than or equal to 9, the program should output the number; otherwise, it should output A for 10, B for 11, C for 12… and Z for 35.
Create a program that calculates the cost of building a desk. The main() function calls four other functions. Pass all variables so that the function makes copies of any variables they receive:
Body Mass Index (BMI) is one of the criteria that is used to calculate whether one is fit or not basing on a person’s height (m) and weight (kg). The criterion is very simple; if one’s BMI is 25 or greater, it signifies overweight. A BMI less or equal to 18.5 indicates underweight. Lastly, a BMI greater than 30 shows obesity.
You have been requested to create a program that that helps the Namibian Defence Forces’ (NDF) Captain to calculates the BMI of a person (BMI = weight/height2) and also determine whether the person has also completed running 10 km in the required time. Men should complete 10km in less than 60 minutes for them to be accepted. Women should do that under 80 minutes. Both males and females are accepted if their BMI is less than 25 and greater than 18.5. For 2018 intake, there are already 6 males selected and 1 female. The values for gender, mass and weight are enter by user inputs
Write a program that will display a calendar given a month and year as an input to the program. Will display only single month of year given. Here it’s that if given input as ( April 2003) will display only the given month of the year.
Write a java program that specifies three parallel one dimensional arrays name length, width, and area. Each array should be capable of holding a number elements provided by user input. Using a for loop input values for length and width arrays. The entries in the area arrays should be the corresponding values in the length and width arrays (thus, area[i] = length [i]* width [i]) after data has been entered display the following output:
Start with the following Python code.
alphabet = "abcdefghijklmnopqrstuvwxyz"
test_dups = ["zzz","dog","bookkeeper","subdermatoglyphic","subdermatoglyphics"]
test_miss = ["zzz","subdermatoglyphic","the quick brown fox jumps over the lazy dog"]
# From Section 11.2 of:
# Downey, A. (2015). Think Python: How to think like a computer scientist. Needham, Massachusetts: Green Tree Press.
def histogram(s):
d = dict()
for c in s:
if c not in d:
d[c] = 1
else:
d[c] += 1
return d
Write a program that simulates
a simple cash register. It should ask the user if a customer is to be
processed. If the user responds yes, prompts the user to enter the
price of the meal. Then it calculates the sales tax (8% of the meal price)
and the total price, which it should display to the user. Next, it asks the
user to enter the amount tendered, and displays the amount tendered, the total
price, and the customer’s change. The program then asks the user if there is
another customer to process. If the user responds yes, the program processes the
next customer in the same way. This procedure continues indefinitely until the
user responds no to the prompt for another customer. Finally, the program
displays the total number of customers it processed and the grand total of all the
meal prices. Input Validation: Do not accept a number less than 1 for the price of the meal. Do not accept a value for the amount tender that is less than the total price.
The screen size of a TV is given by the length of the rectangular diagonal. Traditional TVs come in 4:3 ratio, that is, the ratio of length to width is 4 to 3. This means, if the length is x inches, then the width is (3/4)x. LCD TVs come in 16:9 ratio. Write a program that prompts the user to input the length of the diagonal (in inches) of the screen and allows the user to select which type of TV’s screen length, screen width and screen area the user would like to calculate. Have the program display the desired results.