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
Why do software developers prefer to use high-level language to author programs?
Charra [1.4K]

Answer:

The answer to this question is given below in the explanation section

Explanation:

The correct answer to this question is: it used a more English-like syntax.

The software developer use high-level language to develop or author the program because it is more likely to English syntax and it would be easy for a software developer to author a program easily instead of using low level language and remembering ones and zeros.

Other options are not correct because:

It can be used on computers without microprocessors: Each computer has a microprocessor either you develop a program using high-level or low-level languages. Changes and modifications are easy in high-level language than in low-level languages. so, the option that prevents anyone from making changes to the software later is wrong.  However, high-level languages are less complicated in learning and in authoring the programs but it does not use zeros and ones, it uses English-like syntax. So, the last option is also wrong.  

4 0
2 years ago
Which of these jobs would be most appropriate for someone who majors in information technology? managing a database for a large
Marrrta [24]

Answer:

A good job would be in the IT or getting a job at a network place maybe even a place like Best Buy

Explanation:

7 0
3 years ago
Read 2 more answers
_______ an embedded Word table to activate the Word features.
Bess [88]
The answer is C. double-click
3 0
3 years ago
how do you define technological world is a easier way for this low iq girl to understand its for my essay pls help me im about t
Gelneren [198K]
A world that uses technology.
5 0
3 years ago
Steps of booting a computer
Lostsunrise [7]
Steps of Booting
The Startup. It is the first step that involves switching the power ON. ...
BIOS: Power On Self Test. It is an initial test performed by the BIOS. ...
Loading of OS. In this step, the operating system is loaded into the main memory. ...
System Configuration. ...
Loading System Utilities. ...
User Authentication.
8 0
2 years ago
Other questions:
  • Which does the histogram resemble the most?
    10·1 answer
  • TIFF is the default file format for most digital cameras. State True or False.
    13·1 answer
  • In determining where to store specific data in a(n) centralized DBMS, factors such as communications cost, response time, storag
    12·1 answer
  • Which search engine do you prefer? Why
    15·2 answers
  • Classify the functions of dhcp and dns protocols​
    14·1 answer
  • New product ideas must fit into a company's mission statement and?
    12·1 answer
  • What what do these two parts of the lift do ​
    14·1 answer
  • What is an automatic update and when should you use it
    10·1 answer
  • Guys, if I'm going back to 505 and it's a 7-hour flight or a 45-minute drive how do I get to 505?
    12·1 answer
  • What do people in the movie e.t think about the character E.T
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!