Reference no: EM132356278
Problem 1:
Create a program to calculate the body mass index (BMI) for a person using the person's height in inches and weight in pounds. The program should prompt the user for weight and height.
Calculate the BMI by using the following formula: bmi = (weight / (height * height)) * 703
If the BMI is between 18.5 and 25, display that the person is at a normal weight. If they are out of that range, tell them if they are underweight or overweight and tell them to consult their doctor.
Example Output
Your BMI is 19.5.
You are within the ideal weight range.
Your BMI is 32.5.
You are overweight. You should see your doctor.
Problem 2:
Create a tax calculator that handles multiple states and multiple counties within each state. The program prompts the user for the order amount and the state where the order will be shipped.
Wisconsin residents are charged a base tax of 5%. Wisconsin residents are also charged additional tax based on their county of residence.
- For Eau Claire county residents, add an additional 0.005 tax.
- For Dunn county residents, add an additional 0.004 tax.
Illinois residents must be charged 8% sales tax with no additional county-level charge. All other states are not charged tax. The program then displays the tax and the total for Wisconsin and Illinois residents but just the total for everyone else.
Example Output
What is the order amount? 10
What state do you live in? Wisconsin
What county do you live in? Eau Claire
The tax is $0.55.
The total is $10.55.
Problem 3:
Write a program that converts a number from 1 to 12 to the corresponding month. Prompt for a number and display the corresponding calendar month, with 1 being January and 12 being December. For any value outside that range, display an appropriate error message.
Example Output
Please enter the number of the month: 3
The name of the month is March.
Problem 4:
Create a program that compares two strings and determines if the two strings are anagrams. The program should prompt for both input strings and display the output as shown in the example that follows.
Example Output
Enter two strings and I'll tell you if they are anagrams:
Enter the first string: note
Enter the second string: tone
"note" and "tone" are anagrams.
Problem 5:
Create a program that determines the complexity of a given password based on these rules:
- A very weak password contains only numbers and is fewer than eight characters.
- A weak password contains only letters and is fewer than eight characters.
- A strong password contains letters and at least one number and is at least eight characters.
- A very strong password contains letters, numbers, and special characters and is at least eight characters.
Example Output
The password '12345' is a very weak password.
The password 'abcdef' is a weak password.
The password 'abc123xyz' is a strong password.
The password '1337h@xor!' is a very strong password.