java programming 58

5.27 Lab8Num3

  • 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.

LAB

5.26 Lab8Num2

  • 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
output: $1.00

Sample input: 25
output: $2.50

Sample input: 1000
output: $55.00

Sample input: 2000
output: $60.00

5.25 Lab8Num1

  • 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

Solution:

15% off for this assignment.

Our Prices Start at $11.99. As Our First Client, Use Coupon Code GET15 to claim 15% Discount This Month!!