answer.
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]
1 year 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]1 year 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]1 year 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
A computer scientist creates a necklace to celebrate the birth of her daughter. The necklace encodes her daughter's
Vesna [10]

Answer:

26

Explanation:

I just know it ok; rjkhshwnwjk

5 0
2 years ago
In the program below, what is the scope of strFirst?
MAXImum [283]

First, we have to understand what scope is. When variables are declared, they are only available in the code block they're declared in, unless they're global variables (this doesn't apply here).

strFirst is declared in usernameMaker and that is the only place it is available in.

5 0
1 year ago
Read 2 more answers
You work for a shipping company and your manager receives orders from various customers everyday some existing ,some new .your m
Gennadij [26K]

Answer:

It's good to consider this as a dictionary, with key-value pair, or as a two-dimensional array.

And in the first case, the code will be as below:

day_i={'Bob':'100', 'Alice':'100','Celia':'110','Bob':'200'}

for k, v in day_i.items():

print(k, v)

Explanation:

The above code reads through each day, and each customer purchase amount in the form of Dictionary, and prints each customer name and purchase amount. And with little enhancement, we can create each day data, and print details of the day, as being asked by the user.

6 0
2 years ago
You are an ISP. For the Address Block 195.200.0.0/16 a. If you have 320 Customers that need 128 addresses/customer - will there
12345 [234]

Answer:

a. The network will not satisfy the customers because the required addresses is 128 but what can be offered is 126.

b. 195.200.0.0/22

Explanation:

195.200.0.0/16

The number of bits to give 512 is 9

2^9=512

2^8=256 which is not up to our expected 320 customers that requires a network ip

Note we have to use a bit number that is equal or higher than our required number of networks.

The number of host per each subnet of the network (195.200.0.0/25) is (2^7)-2= 128-2=126

The network will not satisfy the customers because the required addresses is 128 but what can be offered is 126.

b. 64 customers requires  6 bits to be taken from the host bit to the network bit

i.e 2^6 = 64

195.200.0.0/22

The number of host per each subnet of the network (195.200.0.0/22) is (2^10)-2=1024 - 2 = 1022 hosts per subnet

This network meet the requirement " 64 customers want 128 addresses/customer "

5 0
2 years ago
The symbol asterisk(*) in a select query retrieves​
Natali [406]

Answer:

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

Explanation:

The symbol asterisk (*) in a select query retrieve all result of column in the table. For example, table named "employee" has three column such as <em>id, name, address</em>.

To apply the symbol asterisk (*) in select querry select all the columns in the result.

for example:

select * employee;

this query statement selects all columns of table "employee" in the result.

3 0
2 years ago
Other questions:
  • Which data type stores images and audio visual clips?
    15·1 answer
  • A network design engineer has been asked to design the IP addressing scheme for a customer network. The network will use IP addr
    6·1 answer
  • There are no breakpoints in the "Access Customer Account" subpage however there is an error. What will happen if you choose to s
    11·1 answer
  • Consider the relation Courses(C, T, H, R, S, G), whose attributes can be thought of informally as course (C), teacher (T), hour
    10·1 answer
  • Pick a 3D game you enjoy or know about. Pick a scene from that game that has at least one character in it and describe the scene
    9·1 answer
  • Write a function summarize_letters that receives a string and returns a list of tuples containing the unique letters and their f
    15·1 answer
  • Write a program that has the following String variables: firstName, middleName, and lastName. Initialize these with your first,
    7·1 answer
  • What answer best explains why improper netiquette is considered dangerous? Individuals who violate user policies are often charg
    14·2 answers
  • Create an application named SalesTransactionDemo that declares several SalesTransaction objects and displays their values and th
    12·1 answer
  • An aviation tracking system maintains flight records for equipment and personnel. The system is a critical command and control s
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!