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
Agata [3.3K]
4 years ago
9

Write the program to solve quadratic equations, but if the discriminant is negative, output

Computers and Technology
1 answer:
Firdavs [7]4 years ago
8 0

Answer:

PROGRAM  QuadraticEquation Solver

  IMPLICIT  NONE

REAL :: a, b, c ;

  REA :: d ;

  REAL  :: root1, root2 ;

//read in the coefficients a, b and c

  READ(*,*)    a, b, c  

  WRITE(*,*)   'a = ', a

  WRITE(*,*)   'b = ', b

  WRITE(*,*)    'c = ', c

  WRITE(*,*)

// computing the square root of discriminant d

  d = b*b - 4.0*a*c

  IF (d >= 0.0) THEN              //checking if it is solvable?

     d     = SQRT(d)

     root1 = (-b + d)/(2.0*a)     // first root

     root2 = (-b - d)/(2.0*a)     // second root

     WRITE(*,*)  'Roots are ', root1, ' and ', root2

  ELSE                            //complex roots

     WRITE(*,*)  'There is no real roots!'

     WRITE(*,*)  'Discriminant = ', d

  END IF

END PROGRAM  QuadraticEquationSolver

You might be interested in
Hundreds of a bank’s customers have called the customer service call center to complain that they are receiving text messages on
Aleks [24]

Answer:

Customer enlightenment is the key. The bank should communicate with customers and inform them they never asked them to provide their personal information to such a website or an unknown source. I explain steps to take to avoid such fraudulent text messages. If they have responded to such messages, the bank should also guide the customers on steps to take to recover their stolen money.

Explanation:

Customer enlightenment is the key. The bank should communicate with customers and inform them they never asked them to provide their personal information to such a website or an unknown source. I explain steps to take to avoid such fraudulent text messages. If they have responded to such messages, the bank should also guide the customers on steps to take to recover their stolen money.

Some measures to be taken by both the banks and the customers are as follows;

  • The customers should be careful not to call any number people send to them rather they should get any information they need by going to the bank or search for such information on the bank official websites.
  • Customers should be alert and think carefully before sharing any financial details
  • For customers that responded to such messages, the banks will be proactive enough to shut it down and retrieve the customer's funds the same day.
  • Customers are advised to always report such fraudulent messages when received.
  • Banks should frequently verify transactions through telephone or text messages whenever an unusually high or out of the ordinary payments are flagged by its automated systems.
  • The bank can also prevent this fraud by blocking the customer card whenever an unusual transaction is noticed. The customer will then be contacted to confirm if the transaction was genuine or not. At times the transaction may need to be attempted again.

6 0
3 years ago
Which of these is not an execution status of a computer program?
777dan777 [17]

A part of a computer program that performs a well-defined task is known as an algorithm<span>. A collection of computer programs, </span>libraries<span> and related </span>data<span> are referred to as </span>software<span>. Computer programs may be categorized along functional lines, such as </span>application software<span> or </span>system software and running

7 0
4 years ago
_____________ is the characteristic of a resource that ensures that access is restricted to only permitted users, applications,
Maksim231197 [3]

Answer:

The answer to this question is "Confidentiality".

Explanation:

The answer is Confidentiality because in any computer system many files are important for there user. If the file was deleted, corrupted or stolen from the computer. So the user faces the difficulty to avoid this type of problem computer system provides a technique that is access control or it is also known as Confidentiality. It is a technique that controls who or what type of user's use of resources in a computing environment.

So the answer to this question is Confidentiality.

4 0
3 years ago
Input 10 integers and display the following:
LekaFEV [45]

Answer:

// code in C++

#include <bits/stdc++.h>

using namespace std;

// main function

int main()

{

   // variables

   int sum_even=0,sum_odd=0,eve_count=0,odd_count=0;

   int largest=INT_MIN;

   int smallest=INT_MAX;

   int n;

   cout<<"Enter 10 Integers:";

   // read 10 Integers

   for(int a=0;a<10;a++)

   {

       cin>>n;

       // find largest

       if(n>largest)

       largest=n;

       // find smallest

       if(n<smallest)

       smallest=n;

       // if input is even

       if(n%2==0)

       {  

           // sum of even

           sum_even+=n;

           // even count

           eve_count++;

       }

       else

       {

           // sum of odd    

          sum_odd+=n;

          // odd count

          odd_count++;

       }

   }

   

   // print sum of even

   cout<<"Sum of all even numbers is: "<<sum_even<<endl;

   // print sum of odd

   cout<<"Sum of all odd numbers is: "<<sum_odd<<endl;

   // print largest

   cout<<"largest Integer is: "<<largest<<endl;

   // print smallest

   cout<<"smallest Integer is: "<<smallest<<endl;

   // print even count

   cout<<"count of even number is: "<<eve_count<<endl;

   // print odd cout

   cout<<"count of odd number is: "<<odd_count<<endl;

return 0;

}

Explanation:

Read an integer from user.If the input is greater that largest then update the  largest.If the input is smaller than smallest then update the smallest.Then check  if input is even then add it to sum_even and increment the eve_count.If the input is odd then add it to sum_odd and increment the odd_count.Repeat this for 10 inputs. Then print sum of all even inputs, sum of all odd inputs, largest among all, smallest among all, count of even inputs and count of odd inputs.

Output:

Enter 10 Integers:1 3 4  2 10 11 12 44 5 20                                                                                

Sum of all even numbers is: 92                                                                                            

Sum of all odd numbers is: 20                                                                                              

largest Integer is: 44                                                                                                    

smallest Integer is: 1                                                                                                    

count of even number is: 6                                                                                                

count of odd number is: 4

3 0
4 years ago
Routines will depend on the ______________________ and is found in every program you write.
kari74 [83]

Answer:

Open an application (Word, PowerPoint, etc.) and create a new file like you normally would. ...

Click File.

Click Save as.

Select Box as the location where you'd like to save your file. If you have a particular folder that you'd like to save it to, select it.

Name your file.

Click Save.

Explanation:

3 0
3 years ago
Other questions:
  • The collections framework algorithms are __________, i.e., each of these algorithms can operate on objects that implement specif
    9·2 answers
  • Bill's manager has asked him to send all staff members the directions for checking out the new projector. In one to two sentence
    14·2 answers
  • When converting old html code to xhtml, make sure to replace the ____ attribute with the background-color style?
    10·1 answer
  • A(n)_______ is malware that arrives in a trojan, disguised as legitimate software, and then sets up a(n) that provides unauthori
    15·1 answer
  • While it might be considered "old-school," which action should you take if you are unsure how a page will print, even after look
    7·1 answer
  • 1) Open the file DiceSimulation.java attached below. Create a new project on NetBeans called DiceSimulation. Copy the code from
    13·1 answer
  • Database software lets the user sort information alphabetically, chronologically, or numerically. Which is NOT a commonly used d
    7·1 answer
  • Ram is also called __________________________________________________
    11·1 answer
  • What is the result when you run the following program?
    9·2 answers
  • software that opens files and scans their code to look for certain types of malware is known as software.
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!