- Write a program that reads a one-line sentence and then displays the following response:
If the sentence ends with a question mark (?) and the input contains an even number of characters (including the ?) display the word “Yes”.
If the sentence ends with a question mark (?) and the input contains an odd number of characters (including the ?) display the word “No”.
If the sentence ends with an exclamation point (!) display the word “Wow”. In all other cases display “You always say” followed by the input string.
- We would like to assess a service charge for cashing a check. The service charge depends on the amount of the check. If the check amount is less than or equal to $10, we will charge $1. If the amount is greater than $10 but less than or equal to $100, we will charge 10% of the amount. If the amount is greater than $100 but less than or equal to $1000, we will charge $5 plus 5% of the amount. If the amount is greater than $1000 we will charge $40 plus 1% of the amount. Use DecimalFormat to format your output.
Sample input: 8
Sample input: 25
Sample input: 1000
Sample input: 2000
- Write a program to convert a letter grade to an equivalent numeric value on a 4 point scale. Set the value of variable grade to 4.0 for A, 3.0 for B, 2.0 for C, 1.0 for D, and 0.0 for F. For any other input set the value to 0.0 and display an error message: Error, invalid character
Input is from the keyboard.
Output should look like this: The letter grade is A, which is 4.0
Do you need help with this assignment? Or a different one? We got you covered.