# In this program a set of questions are asked and user has to find the correct answers

Přejít na: navigace, hledání

Program: Mathspro.pas
Súbor exe: Mathspro.exe

In this program a set of questions are asked and user has to find the correct answers.
```{ MATHSPRO.PAS                                                      }
{ In this program a set of questions are asked and user has to find }
{                                                                   }
{ Author: Unknown                                                   }
{ Datum:20.01.2009                             http://www.trsek.com }

program maths_problem;

uses crt;

var
x: integer;
x2:integer;
y:integer;
z:integer;
u:integer;
counter:integer;

begin
clrscr;
counter := 0;
writeln;
writeln;
writeln;
textcolor (15);
writeln('1) John has x pencils and Kate has 7 pencils. Mike has 2x+y pencils.');
writeln('  together John and Kate have 10 pencils and Mike has 15 pencils.Find x,2x and y');
write ('ans of x is ');
if (x = 3)
then
begin
writeln;
end
else
begin
writeln;
end;
writeln;
write ('ans of 2x is ');
if (x2 = 6)
then
begin
writeln;
end
else
begin
writeln;
end;
writeln;
write ('ans of y is ');
if (y=9)
then
begin
writeln;
end
else
begin
writeln;
end;
if (x = 3) and (x2 = 6) and (y=9)
then
begin
counter := counter + 1;
end;
writeln;
writeln;
writeln;
writeln;
writeln;
writeln;
writeln;
writeln ('2) Sam has G+y-z candy and Mary has 10 more candy then Sam.');
writeln ('  Together Sam and Mary have 50 pieces of candy. Find z if G=10,y=G+5.');

writeln;
Write ('ans of z is ');
if (z=5)
then
begin
writeln;
counter :=counter+1;
end
else
begin
writeln;
end;
writeln;
writeln;
writeln;
writeln;
writeln;
writeln;
writeln;
writeln ('3)  Alis has 9-i plants and  Mark has u+i plants.');
writeln (' Together They have 16 plants.Find u if i=4.');
writeln;
Write ('ans of u is ');
if (u=7)
then
begin
writeln;
counter :=counter+1;
end
else
begin
writeln;

end;
writeln;
writeln;
writeln;
if counter = 3 then
begin
writeln('                  Congratulations all answers are correct!!!');
end;
if counter = 2 then
begin
writeln ('                 You scored 2 out of 3');
end;
if counter = 1 then
begin