From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on ip-172-31-65-14.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-0.0 required=3.0 tests=BAYES_40,FREEMAIL_FROM, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Received: by 2002:a05:622a:24e:b0:3df:9e4:36c6 with SMTP id c14-20020a05622a024e00b003df09e436c6mr9190662qtx.3.1680212984002; Thu, 30 Mar 2023 14:49:44 -0700 (PDT) X-Received: by 2002:a81:a805:0:b0:546:6ef:8baf with SMTP id f5-20020a81a805000000b0054606ef8bafmr6874024ywh.2.1680212983670; Thu, 30 Mar 2023 14:49:43 -0700 (PDT) Path: eternal-september.org!feeder.eternal-september.org!news.uzoreto.com!peer03.ams4!peer.am4.highwinds-media.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Thu, 30 Mar 2023 14:49:43 -0700 (PDT) Injection-Info: google-groups.googlegroups.com; posting-host=118.93.181.209; posting-account=g6PEmwoAAADhFsmVm6Epjviaw4MLU0b5 NNTP-Posting-Host: 118.93.181.209 User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <3db3c046-bbcf-497b-afd5-ac6c2b9567afn@googlegroups.com> Subject: ChatGPT From: Anatoly Chernyshev Injection-Date: Thu, 30 Mar 2023 21:49:43 +0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Received-Bytes: 2755 Xref: feeder.eternal-september.org comp.lang.ada:65025 List-Id: Just had an exercise with ChatGPT for Ada. Here is what my request was: "Produce Ada code for solving a quadratic equa= tion." And here's the output from ChatGPT (quite flawless forgiving the absence of= a math lib in the header): ---------------------------- with Ada.Text_IO; use Ada.Text_IO; procedure Quadratic_Equation is A, B, C, D : Float; X1, X2 : Float; begin -- read coefficients A, B, and C from the user Put("Enter coefficient A: "); Get(A); =20 Put("Enter coefficient B: "); Get(B); =20 Put("Enter coefficient C: "); Get(C); -- calculate the discriminant D :=3D B*B - 4.0*A*C; -- check if the discriminant is negative if D < 0.0 then Put_Line("No real roots exist."); else -- calculate the roots X1 :=3D (-B + Sqrt(D)) / (2.0*A); X2 :=3D (-B - Sqrt(D)) / (2.0*A); =20 -- output the roots Put_Line("Root 1 =3D " & Float'Image(X1)); Put_Line("Root 2 =3D " & Float'Image(X2)); end if; end Quadratic_Equation; and an extra remark: Note that this implementation assumes that the discriminant (B^2 - 4AC) is = positive or zero. If the discriminant is negative, then no real roots exist= . ----------------------------------------------- Before crying wolf, my impression is that ChatGPT might be useful for draft= ing simple pieces of code (say, homeworks). Very soon though one will arriv= e at a situation when the amount of efforts to explain the task to ChatGPT = will be the same as to write the code yourself (I shall call it a limiting = Kolmogorov complexity). What do you think?