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
stepladder [879]
3 years ago
9

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

n, that 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 function
Computers and Technology
1 answer:
hoa [83]3 years ago
5 0

Answer:

   public static void quad(double a, double b, double c) {

       double D = (Math.pow(b, 2)) - (4 * a * c);

       if (D<0){

           System.out.println("no real solutions");

       }

   }

Explanation:

The code snippet above implements the function in Java programming language

As required by the question, the line  double D = (Math.pow(b, 2)) - (4 * a * c); evaluates b squared" - 4ac and assignes the value to the variable D

An if statement is used to test if D is less than 0, if this is true the message no real solutions is printed

You might be interested in
In the ____________________ technique, the virus is divided into several parts and the parts are placed at random positions thro
shusha [124]

Answer:

Split Infection

Explanation:

In the split infection technique, each time the file is opened either by the user or the system operating system, the virus copy itself into another file on the same system and unload malicious payloads to perform some actions. While this is ongoing, the virus erase file from the user hard drive and might even go as formatting the hard disk drive.

It should be noted that the virus cannot transfer itself from one computer to another

5 0
3 years ago
You find that you are missing a very important file. After much searching, you have determined that it is no longer on your comp
Pani-rosa [81]

You can use backup utility programs and file management programs.

5 0
3 years ago
Read 2 more answers
How can i do a back up on one computer and save it to the hard drive in another computer without it being seen by others on the
Ganezh [65]
Unless you share the backup HD only the local user is going to see it. Given that it's a server, it's not a problem. You can also hide the backup with attributes +h +s and many other ways.
8 0
3 years ago
Is a network traffic management device used to connect different network segments together?
son4ous [18]
No, network traffic management software is only concerned with the health of the Network.
7 0
3 years ago
Using a text editor, create a file that contains a list of at least 15 six-digit account numbers. Read in each account number an
Zanzabum

Answer:

See explaination

Explanation:

/File: ValidateCheckDigits.java

import java.io.BufferedWriter;

import java.io.File;

import java.io.FileWriter;

import java.io.IOException;

import java.util.Scanner;

public class ValidateCheckDigits {

public static void main(String[] args) {

String fileName = "numbers.txt"; //input file name

String validFileName = "valid_numbers.txt"; // file name of the output file

//Open the input file for reading and output file for writing

try(Scanner fileScanner = new Scanner( new File(fileName));

BufferedWriter fileWriter = new BufferedWriter( new FileWriter(validFileName))) {

//Until we have lines to be read in the input file

while(fileScanner.hasNextLine()) {

//Read each line

String line = fileScanner.nextLine().trim();

//calculate the sum of first 5 digits

int sum = 0;

for(int i = 0; i < 5; i++) {

sum += Integer.parseInt( line.charAt(i) + "");

}

//Get the last digit

int lastDigit = Integer.parseInt(line.charAt(5)+"");

//Check if the remainder of the sum when divided by 10 is equal to last digit

if(sum%10 == lastDigit) {

//write the number in each line

fileWriter.write(line);

fileWriter.newLine();

System.out.println("Writing valid number to file: " + line);

}

}

System.out.println("Verifying valid numbers completed.");

} catch(IOException ex ) {

System.err.println("Error: Unable to read or write to the file. Check if the input file exists in the same directory.");

}

}

}

Check attachment for output and screenshot

4 0
3 years ago
Other questions:
  • c++ design a class named myinteger which models integers. interesting properties of the value can be determined. include these m
    14·1 answer
  • A Trojan horse is a program that copies itself repeatedly using up resources and potentially shutting down a network. true or fa
    11·1 answer
  • Bullets in a text box will do which of the following?
    9·2 answers
  • Which of the following identifies the patterns used for each data series in a chart?
    13·1 answer
  • When you set up a worksheet, you should use cell references in formulas whenever possible, rather than ____ values.
    11·1 answer
  • Is there a relationship between cybercrime and traditional crime?
    6·1 answer
  • . Write a short program that asks the user to input a string, and then outputs the
    15·1 answer
  • What is copy and paste?
    13·2 answers
  • Can somebody help me with this please
    6·2 answers
  • Make variables to represent the length and width of a rectangle, called length and width, respectively. You should set length to
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!