1. Engineering
  2. Computer Science
  3. in java you must provide test cases for each problem...

Question: in java you must provide test cases for each problem...

Question details
  • In Java

  • You must provide test cases for each problem to justify that your program works. Sometimes you may want to test more than one case.Question 4 (10 points): Solutions for a quadratic equation ax2 + bx + c = 0 where a 0 are as follows. 2a 2a if b2-4ac< 0, equation doesnt have real roots. If it is 0 there is one root r 2). Write a Java program to read a, b and c from keyboard and find the roots, if they exist. Note: You need to have a method that takes 3 real values as arguments. Question 5 (20 points): Write a program to determine all pairs of positive integers, (a, b), such that a b<n and (a2 +b21/(ab) is an integer Here n is an integer and n > 2. Note: Your program should have a method that takes n as a parameter and print all valid pairs as (a, b). Show the corresponding pairs for n 1000 as a test case. hat a < b< n and (a2 +b2

Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution