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]
3 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]3 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]3 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
You have been asked to investigate a web server for possible intrusion. You identify a script with the following code. What lang
nignag [31]

The code below is written in JavaScript and does not seem malicious.

<h3>What is a Malicious Code?</h3>

A Malicious code is one that is not designed for any productive end but to cause disruptions in the computer with the objective of

  • harming the workstation; or
  • destroying the data stored therein.

There are numerous classifications of malicious codes and they can be identified and removed by an application called an Anti-Virus or malicious app remover.

Learn more about JavaScript at:
brainly.com/question/16698901

8 0
3 years ago
 Formulas within table cells always begin with
Delicious77 [7]
(D) I don't know about other spread sheet software, but in Microsoft Excel, a formula is always entered beginning with an 'equals' sign. ( = ).
4 0
3 years ago
One of the benefits of conditional ____________________ is that it helps you analyze data by highlighting significant trends in
Lelu [443]

Answer is Formatting

When conditional formatting is applied to your data, you can quickly and easily identify variances in different values within a quick glance. This makes worksheets easier to comprehend. With conditional formatting, you are able to apply formatting such as icons, data bars, and colors.

 

 

 






5 0
4 years ago
You have a network with a subnet of 172.16.17.0/22. Which of the following is a valid host address?A. 172.16.17.1 255.255.255.25
Licemer1 [7]

Answer:

E. 172.16.18.255 255.255.252.0

Explanation:

Oh goodie, this is my home turf.

The answer is E) 172.16.18.255 255.255.252.0

This is because your subnet network ID includes mask \22, which means the ending with 255 255.255.252.0, which is standard for Class B. Only option E falls as an adequate host due to the network being 172.16.16 and broadcasting 16.19.

7 0
3 years ago
What type of websites, which let users share personal stories and photos, became popular in the 2000s?.
Lina20 [59]

Answer:

MMORPGS was a type of website that let users share their stories and pics across the world wide web

Explanation:

8 0
3 years ago
Other questions:
  • What is the output after the following code executes?
    14·1 answer
  • ​a(n) ____ is a communications device that connects a communications channel such as the internet to a device such as a computer
    11·1 answer
  • Write a SELECT statement that returns these column names and data from the Order_Items table:
    14·1 answer
  • Nina is 12 years old. She has just changed her password and wants to make sure she has it in case of
    15·2 answers
  • Which is the correct APA format in books?​
    10·2 answers
  • The primary reason for a company to outsource jobs is to
    8·2 answers
  • Use the drop-down menus to complete the statements about how to crop an image in a word document.​
    5·2 answers
  • Use the {blank} to view your presentation the way an audience will see it.
    13·2 answers
  • What does c++ programming mean?
    7·1 answer
  • Answer pls pls pls pls ​
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!