Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.

I don’t understand why my program isn’t running

+1 vote
asked Oct 27, 2019 by KymaniStone (130 points)
program Calculate_Grade

const

Course_percent = 0.4;

Exam_percent = 0.6;

var

   Stufname, Stulname, Cname: Array [1..3] of string;

   StuId, Finalg : Array[1..3] of real;

   Cgradepoint, Egradepoint:real;

   Cgrade,Egrade : Array [1..3] of real;

   Coursep,ExamP: real;

   G : Integer;

   sum : Real;

   A : 80..100;

   B : 70..79;

   C : 50..69;

   D : 40..49;

   

begin

  For G:= 1 to 3 do

Begin

  writeln('Enter Student First Name');

  Readln(Stufname[G]);

  writeln('Enter Student last Name');

  Readln(Stulname[G]);

  writeln('Enter Student Id Number');

  Readln(StuID[G]);

  writeln('Enter Course Name');

  Readln(Cname[G]);

  writeln('Enter Course Grade');

  Readln(Cgrade[G]);

  writeln('Enter Exam Grade');

  Readln(Egrade[G]);

  

  

  Cgradepoint:=Course_percent*Cgrade[G];

  Egradepoint:=Exam_percent*Egrade[G];

  

  write('Course percentage is:',Cgradepoint :1:1); write('%');

  writeln();

  writeln();

  write('Exam percentage is:',Egradepoint :1:1); write('%');

  

  sum:=Cgradepoint + Egradepoint;

  writeln('Final_Grade is',sum :1:1);

  

  if sum >= A

  then

  writeln('Grade letter is: A')

  else

  if sum >= B

  then;

  writeln('Grade letter is:B')

  else

  if sum >= C

  then

  writeln('Grade letter is:C')

  else

  if sum >= D

  then

  writeln ('Grade letter is:D')

  

  

   End;

   End;

1 Answer

+1 vote
answered Dec 15, 2022 by Henry Cooper (200 points)
What language is this?
commented Dec 16, 2022 by Peter Minarik (84,720 points)
It's Pascal.

One has to follow the error messages and fix them. Missing semicolons, uninitialized variables, etc. The error messages are pretty clear on what's wrong.
Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.
...