954,529 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Any help with variables pls?

Hey can someone please tell me what kind of variables i should use when making a class mark program ? thanks :)

mrs.r
Newbie Poster
3 posts since Aug 2010
Reputation Points: 10
Solved Threads: 0
 

Can you send us abit more information about your problem?

FlamingClaw
Posting Pro
559 posts since Feb 2009
Reputation Points: 132
Solved Threads: 138
 

i have a programming project and i chose the class marks program. i need to insert the student names,marks and the names of subject (ex: English,Maths ....)
my problem here is that i'm stuck in what i have to input variables

thankyou

mrs.r
Newbie Poster
3 posts since Aug 2010
Reputation Points: 10
Solved Threads: 0
 

I made a solution, I need more information about your program if it is not good for you.

Program students;
Uses Crt, Dos;

Const n = 2;
      m = 3;
Type subs = Array[1..m]Of Record
                            sub_name: String[20];  {example: english, or math, or geometry, etc}
                            mark: String[2];
                          End;

Type student = Record
                 student_name: String;
                 subjects: subs;
               End;

Var TheClass: Array[1..n] Of student;
    i,j:Byte;



Begin {main}
   ClrScr;

   {fill up}
   For i:=1 To n Do Begin
     WriteLn('----');
     With TheClass[i] Do Begin
       Write(i,'. Student Name : ');
       ReadLn(student_name);
       WriteLn('Subject: ');
       For j:=1 To m Do Begin
          With subjects[j] Do Begin
            Write(j,'. Subject: ');
            ReadLn(sub_name);
            Write('Subject mark: ');
            ReadLn(mark);
          End;
       End;
     End;
   End;
   WriteLn;
   WriteLn('Ok, let''s write the 2. pupil''s data: ');
   WriteLn;
   With TheClass[2] Do Begin
     WriteLn('Student''s Name: ',student_name);
     WriteLn('Subjects are: ');
     j:=1;
     While (j<=m) Do Begin
       WriteLn(subjects[j].sub_name:20,'   ','Mark: ',subjects[j].mark);
       Inc(j);
     End;
   End;

   ReadKey;
End.
(*Created By FlamingClaw 2010.Augusztus.13.Pentek.*)
FlamingClaw
Posting Pro
559 posts since Feb 2009
Reputation Points: 132
Solved Threads: 138
 

Thankyou so much ,

appriciated

mrs.r
Newbie Poster
3 posts since Aug 2010
Reputation Points: 10
Solved Threads: 0
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: