Answered step by step
Verified Expert Solution
Question
1 Approved Answer
in Java language Thank you Lab Tasks- complete these and show instructor before leaving Use the information provided here and in chapter 8 of our
in Java language Thank you
Lab Tasks- complete these and show instructor before leaving Use the information provided here and in chapter 8 of our text to do the following exercises before you leave. 1) In your first programming project you created a java file called Quadratic.java, which took the Coefficients of a quadratic equation and gave the two solutions for the variable X. At the time we assumed the user would give us three values that would successfully work. However if the user gave us a zero for the A term or a set of values that caused ( B2-4AC) to be non-positive, we would end up not getting two rational solutions. Your job is to add the code required to throw exceptions if either of these above conditions happen. Put try and catch blocks in your code in a way that will force the user to enter the values again if they are not good ones. 2) Write a program that asks the user to input 5 positive integers. Have your brow ovco ntions if apy given values are negative, and protect againstStep 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