Question
I'm getting stucked to write the code for these 2 hard problems in Java. Please help me in specific for the solution. Thank you! 1.
I'm getting stucked to write the code for these 2 hard problems in Java. Please help me in specific for the solution. Thank you!
1. A certain grade of steel is graded according to the following conditions: (i) Hardness must be greater than 50 (ii) Carbon content must be less than 0.7 (iii) Tensile strength must be greater than 5600 The grades are as follows: Grade is 10 if all three conditions are met Grade is 9 if conditions (i) and (ii) are met Grade is 8 if conditions (ii) and (iii) are met Grade is 7 if conditions (i) and (iii) are met Grade is 6 if only one condition is met Grade is 5 if none of the conditions are met Write a program, which will require the user to give values of hardness, carbon content and tensile strength of the steel under consideration and output the grade of the steel.
2. A library charges a fine for every book returned late. For first 4 days the penalty is 25 cents per day, for the next 6 days the penalty is 50 cents per day and for each consecutive 5 day periods in excess of 10 days, the penalty is 5 dollars per period. For example, if the book is returned after 11 days, the penalty is $(2+3+5) = $10. The penalty of returning the book after 15 days is also $10, whereas if you return it after 16 days, it becomes $15. If the book is returned after 30 days, the borrower's membership will be cancelled. Write a program to accept the number of days the member is late to return the book and display the fine or the appropriate message.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started