Due: Friday 15 July at 10:00 pm

## Purpose

• Get experience with conditional statements and how to program to solve mathematic problem.

## Partners

This is an individual assignment, though collaboration (not solution sharing) is allowed.

## Problem Statement

You are going to program a mathematician that can only solve the quadratic equation/inequalities problem. The program should give correct answers to all the input quadratic equation/inequalities that you give.

• Create a project called Inlab5.
• Type this code into a class called Driver.
• Type this code into a class called Inequality (You won't need to modify this class).
• Look through both and make sure you understand the general flow of things.
• Create the class Mathematician and make the methods you need. (Hint: You don't need any instance variables, or even a constructor in the Mathematician class).
• The methods you create in Mathematician should employ switch/if/if-else/if-elseif statements that follow this table:
1. In Mathematician class, create a static method named root(...) that takes the Inequality and print out the answer key to the inequaility without returning any value. Within the root method, start with an if, else if, else statement on the getDelta() value comparing it with 0.
2. Within each if, elseif ,else, either switch on the relational operators of the inequalities("=",">",or less) or use if-elseif-else statement to calculate each cases.
3. After the root method is finished, within the Mathematician class, create a static method named root_1 that takes in three parameters(Delta, a, c) and return the smaller root of the inequaility.
4. After the root_1 method is created, make the same method for root_2 that returns the greater root of the inequality.
• Test on following instances of Inequalities: 1, -1, 1, ">"; 1, -1, -6, ">"; and when they are less than 0.
• Your output should look similar to this.Print out the inequalities and print out the solution. You may change the Driver class only on the parameters of the creat the Inequality

## Submission

By Friday night at 10:00 pm, submit the files Mathematician.java into the appropriate D2L dropbox folder. DO NOT SUBMIT .class files.