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
garri49 [273]
3 years ago
12

Write a program in pascal to solve a quadratic equation

Computers and Technology
1 answer:
GalinKa [24]3 years ago
5 0
Program p1;
var a,b,c,d : integer; {i presume you give integer numbers for the values of a, b, c }
     x1, x2 : real;
begin 
write('a='); readln(a);
write('b='); readln(b);
write('c=');readln(c);
d:=b*b - 4*a*c
if a=0 then x1=x2= - c/b
          else
if d>0 then begin 
                 x1:=(-b+sqrt(d)) / (2*a);
                 x2:=(-b - sqrt(d))/(2*a);
                end;
          else if d=0 then x1=x2= - b /(2*a)
                           else write ("no specific solution because d<0");
writeln('x1=', x1);
writeln('x2=',x2);
readln;
end.
You might be interested in
What is the difference between HTML and CSS? * 1. CSS is a markup language unlike HTML. 2. HTML is a backend technology and CSS
GarryVolchara [31]
The anserw is the third one. 
5 0
3 years ago
Read 2 more answers
Write multiple if statements: If carYear is before 1967, print "Probably has few safety features." (without quotes). If after 19
Liono4ka [1.6K]

Answer:

public class Main

{

public static void main(String[] args) {

    int carYear = 1995;

   

    if(carYear < 1967)

        System.out.println("Probably has few safety features.");

    if(carYear > 1971)

        System.out.println("Probably has head rests.");

    if(carYear > 1992)

        System.out.println("Probably has anti-lock brakes.");

    if(carYear > 2002)

        System.out.println("Probably has tire-pressure monitor.");

   

}

}

Explanation:

The code is in Java.

Initialize the carYear

Use if statements to handle year before 1967, after 1971, after 1992 and after 2002.

Print the required message for each if statement

5 0
2 years ago
You are working on a project and need to be able to access the content from home and share the files with other team members. Th
inn [45]
Local server so you can all you use if you guys are near
5 0
3 years ago
Read 2 more answers
// This pseudocode segment is intended to compute and display
Finger [1]

The pseudocode to calculate the average of the test scores until the user enters a negative input serves as a prototype of the actual program

<h3>The errors in the pseudocode</h3>

The errors in the pseudocode include:

  • Inclusion of unusable segments
  • Incorrect variables
  • Incorrect loops

<h3>The correct pseudocode</h3>

The correct pseudocode where all errors are corrected and the unusable segments are removed is as follows:

start

Declarations

     num test1

     num test2

     num test3

     num average

output "Enter score for test 1 or a negative number to quit"

input test1

while test1 >= 0

     output "Enter score for test 2"

     input test2

     output "Enter score for test 3"

     input test3

     average = (test1 + test2 + test3) / 3

     output "Average is ", average

     output "Enter score for test 1 or a negative number to quit"

     input test1

endwhile

output "End of program"

stop

Read more about pseudocodes at:

brainly.com/question/11623795

3 0
2 years ago
45. Our goals are a reflection of our:
ZanzabumX [31]
Values hope it helps you
4 0
2 years ago
Other questions:
  • Java - Given a String variable response that has already been declared, write some code that repeatedly reads a value from stand
    12·1 answer
  • Over time, programming languages have evolved in phases called ________.
    5·2 answers
  • A statement describing both the requirements that must be met by a product or process amd the ways in which satisfaction of the
    8·2 answers
  • Brainlist will be added!✴
    6·1 answer
  • Write an assembly language program with a loop and indexed addressing that calculates the sum of all the gaps between successive
    11·1 answer
  • Help with this chart please
    9·1 answer
  • What do you do to add a line or circle to your presentation?
    7·2 answers
  • __________ is a protocol used by e-mail clients to download e-mails to your computer.
    14·1 answer
  • What is a third variable condition that could create the following correlation?
    10·2 answers
  • what will happen to the contents of the destination ell if you copy the contents of the source cell into the destination cell
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!