1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
konstantin123 [22]
2 years ago
6

Given that a method receives three parameters a, b, c, of type double, write some code, to be included as part of the method, th

at determines whether the value of "b squared" – 4ac is negative. If negative, the code prints out the message "no real solutions" and returns from the method
Computers and Technology
2 answers:
Debora [2.8K]2 years ago
6 0

Answer and Explanation:

class Dis

{

public static void main(String args[])

{

Scanner sc=new Scanner(System.in);

System.out.println("Enter values for a,b,c");

double a=sc.nextDouble();

double b=sc.nextDouble();

double c=sc.nextDouble();

String s=discriminant(a,b,c);

System.out.println(s);

}

public String discriminant(double a, double b, double c)

{

double result;

result=(b^2-4ac);

if(result<0)

return "no real solutions"";

else return "";

}

}

Note:This program is written in JAVA

Llana [10]2 years ago
3 0

Answer:

The solution code is written in Java:

  1.   public static boolean check_discriminant(double a, double b, double c)
  2.    {
  3.        double discriminant = b * b - (4 * a * c);
  4.        if(discriminant > 0){
  5.            return true;
  6.        }
  7.        else{
  8.            System.out.println("no real solutions");
  9.            return false;
  10.        }
  11.    }

Explanation:

Firstly, we define a function check_discriminant() that takes three parameters with double type,<em> a, b and c </em>(Line 1).

Next, we calculate the discriminant using the formula b² - 4ac (Line 3). We place the discriminant in if condition (Line 5) to see if it is a negative or positive value. If positive return true (Line 6) and if negative it will print out message "no real solutions" and return false (Line 9 -10).

You might be interested in
I need help 50 points and brainless if you answer
nata0808 [166]

Answer:

50

var X gets passed into the rectangle function, which I assume would set the x and y coordinates to what the var's have already been set to.

4 0
2 years ago
Read 2 more answers
What method of the String object searches the string for an occurence of the specified search string?
KATRIN_1 [288]

Answer:

the indexOf() method

Explanation:

The indexOf() method in java returns the first occurrence of the of the string or a character specified in it.It can be used to search both a character or a string.

for example:-

import java.util.*;

import java.lang.*;

import java.io.*;

class indexOf

{

public static void main (String[] args)

{

    String s="IamNumber4";

    int l=s.indexOf("Num");//using indexOf() method on string object..

    System.out.println(l);

}

}

Output:-

3

3 0
3 years ago
B. Find Addition of Binary Numbers: 1100112 + 11012
schepotkina [342]
Hello, I assume you mean 110011_2 + 1101_2

To add 110011+ 1101 we can setup the problem like the following:

   110011
+     1101 
-------------
  1000000

When we add 1 + 1 this equals 10 so we just carry the 1 and we keep doing that from right to left. Also 1 + 0 = 1 

7 0
3 years ago
"______" is a wireless local network that uses high frequency radio signals to transmit an Internet signal from a wireless route
Hitman42 [59]

Answer:

Modem possibly

6 0
3 years ago
Which of the following are reasons someone can be legally fired? Check all of the boxes that apply. An employee is sleeping on t
Musya8 [376]

Answer:

employee has been sleeping on the job

An employee has been late to work 7 times in a row  

Explanation:

It just it the right answer for career prep edg2021.

3 0
1 year ago
Read 2 more answers
Other questions:
  • Your desktop computer monitor is not displaying a picture. What would you do to troubleshoot the problem?
    7·2 answers
  • In the cases of int, byte, long, short (In Java) Can you give the heirachy in ascending order?​
    6·1 answer
  • Which question about whale sharks is nonscientific?
    11·2 answers
  • What can you find the under the privacy policy section of a shopping website?
    12·1 answer
  • What is the best way to improve the following code fragment? if ((counter % 10) == 0) { System.out.println("Counter is divisible
    11·1 answer
  • Write a paragraph about ICT in personal life?
    12·1 answer
  • -- of 5 points Question 3 1 try left While designing a new system, a company uncovered several processes that were quite rule-ba
    6·1 answer
  • Differentiate between soft copy output and hard copy output?​
    12·2 answers
  • What are the different elements of a window?​
    10·1 answer
  • your manager asked you to set up a secure network connection at a remote site to move over some back ups. what protocol what do
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!