GuideFoot - Learn Together, Grow Smarter. Logo

In Mathematics / College | 2025-08-20

Austin is mailing packages. Each small package costs him $2.80 to send. Each large package costs him $3.90. How much will it cost him to send 1 small package and 3 large packages?

Asked by alexx9s

Answer (2)

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.

Answered by daniela88 | 2024-06-10

To solve a quadratic equation in Pascal, use the quadratic formula to calculate the roots based on user-input coefficients. The program checks the discriminant to determine if there are zero, one, or two real roots. The sample code provided illustrates how to implement this in a Pascal program.
;

Answered by daniela88 | 2024-12-23