Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,155,583 members, 7,827,169 topics. Date: Tuesday, 14 May 2024 at 08:20 AM

How To Solve A Grade Problem Using A Pascal (lazarus IDE) - Programming - Nairaland

Nairaland Forum / Science/Technology / Programming / How To Solve A Grade Problem Using A Pascal (lazarus IDE) (2420 Views)

AIDE-IDE For Java And C/C++ And AIDE for Web Worth It ? / How Can I Set Up Or Run My Python IDE On VS Code On Windows 8 / Pls I Need To Solve A Problem Troubling Me (2) (3) (4)

(1) (Reply) (Go Down)

How To Solve A Grade Problem Using A Pascal (lazarus IDE) by Pleasant1: 7:01pm On Jun 22, 2019
please help me in solving this problem.

write a pascal program to calculate the CGPA for HND program. the program should accept grades for courses in each semester, print the CGPA for HND I, repeat the process for HND II and display the CGPA for HND program and determine whether it is distinction, upper credit, low or pass level.
Re: How To Solve A Grade Problem Using A Pascal (lazarus IDE) by stanliwise(m): 7:08pm On Jun 22, 2019
Pleasant1:
please help me in solving this problem.

write a pascal program to calculate the CGPA for HND program. the program should accept grades for courses in each semester, print the CGPA for HND I, repeat the process for HND II and display the CGPA for HND program and determine whether it is distinction, upper credit, low or pass level.
Have you gotten a solution already??

If not, just make use of array to hold list of grades, then use a loop to collect each input.
finally, use loop to go over the array, add up, make your division of the sum and use if to output class and GP.

2 Likes

Re: How To Solve A Grade Problem Using A Pascal (lazarus IDE) by Pleasant1: 7:10pm On Jun 22, 2019
No
Re: How To Solve A Grade Problem Using A Pascal (lazarus IDE) by stanliwise(m): 7:13pm On Jun 22, 2019
Pleasant1:
No
It ia quite straight forward, see my last post
Re: How To Solve A Grade Problem Using A Pascal (lazarus IDE) by Pleasant1: 7:19pm On Jun 22, 2019
stanliwise:
It ia quite straight forward, see my last post
Alright, let me try this. thanks

1 Like

Re: How To Solve A Grade Problem Using A Pascal (lazarus IDE) by asalimpo(m): 10:24am On Jun 23, 2019
Op, Why r using such an obscure toolset over mainstream alternatives? @pleasant1
Re: How To Solve A Grade Problem Using A Pascal (lazarus IDE) by Pleasant1: 2:24pm On Jun 23, 2019
asalimpo:
Op, Why r using such an obscure toolset over mainstream alternatives?
@pleasant1


i am under instruction. i need to use it. I'm a beginner in programming, help me out with the code please.
Re: How To Solve A Grade Problem Using A Pascal (lazarus IDE) by airsaylongcon: 3:05pm On Jun 23, 2019
List out the grades and the points for each grade. Also list out the courses by semester for HND I and HND II
Re: How To Solve A Grade Problem Using A Pascal (lazarus IDE) by stanliwise(m): 5:31pm On Jun 23, 2019
Pleasant1:


i am under instruction. i need to use it. I'm a beginner in programming, help me out with the code please.
I can help you with the codes and explanation for a token. But with google search and the instructions I gave you earlier you should be able to implement it. Learn to code.
Re: How To Solve A Grade Problem Using A Pascal (lazarus IDE) by soleexx(m): 5:49pm On Jun 23, 2019
Java would have been easier
Re: How To Solve A Grade Problem Using A Pascal (lazarus IDE) by asalimpo(m): 8:54pm On Jun 23, 2019
Pleasant1:


i am under instruction. i need to use it. I'm a beginner in programming, help me out with the code please.
Your lecturer is an a@$$hole. S/he needs to be sacked. Or flogged. Anyway, I can help but I program in java. It's more complex than u think,the main issue is in creating a smooth nd beautiful design. So I'll give some tips:
1.) create a timeBlock object
Don't worry what timeBlock means,it's just a conceptual object representing a collection of courses. So a semester system will contain two timeBlock per session and trimester system would contain 3 timeBlock per session. Also if carry overs are done in the same calendar year, then it would go into the session object.

2.) Abstract the calculative functionalities into an interface. Many objects will share this traits. E.g a timeblock- and timeBlock container -session,programme all perform similar actions like: compute GPA,compute cgpa,compute credit hours, etc. All these objects will implement these functions from the interface.
Etc.
The reason for all these abstractions is so that in d future,your code base can b adapted to any school system with very little modification.
It can easily get robust.
I am assuming that u are using the object oriented paradigm.
The right data structure for the internals of the timeBlock should be a dynamic one. That grows nd shrinks as necessary. Arrays will waste memory.
A hash map or set will do.
Good luck.
Re: How To Solve A Grade Problem Using A Pascal (lazarus IDE) by stanliwise(m): 10:27pm On Jun 23, 2019
asalimpo:

Your lecturer is an a@$$hole. S/he needs to be sacked. Or flogged. Anyway, I can help but I program in java. It's more complex than u think,the main issue is in creating a smooth nd beautiful design. So I'll give some tips:
1.) create a timeBlock object
Don't worry what timeBlock means,it's just a conceptual object representing a collection of courses. So a semester system will contain two timeBlock per session and trimester system would contain 3 timeBlock per session. Also if carry overs are done in the same calendar year, then it would go into the session object.

2.) Abstract the calculative functionalities into an interface. Many objects will share this traits. E.g a timeblock- and timeBlock container -session,programme all perform similar actions like: compute GPA,compute cgpa,compute credit hours, etc. All these objects will implement these functions from the interface.
Etc.
The reason for all these abstractions is so that in d future,your code base can b adapted to any school system with very little modification.
It can easily get robust.
I am assuming that u are using the object oriented paradigm.
The right data structure for the internals of the timeBlock should be a dynamic one. That grows nd shrinks as necessary. Arrays will waste memory.
A hash map or set will do.
Good luck.
Someone don't know how to write simple instructions, you're talking about abstraction. hian.
And also Fortran is still favoured among scientists today because of it heavy computing library. Before any arguments, it is used heavily by weather forceast station and some air travelling company. Its last updated compiler is 2018 also.

3 Likes 1 Share

Re: How To Solve A Grade Problem Using A Pascal (lazarus IDE) by asalimpo(m): 11:36pm On Jun 23, 2019
stanliwise:
Someone don't know how to write simple instructions, you're talking about abstraction. hian.
And also Fortran is still favoured among scientists today because of it heavy computing library. Before any arguments, it is used heavily by weather forceast station and some air travelling company. Its last updated compiler is 2018 also.
i know but so are lisp nd ada.
But this isnt d reason it's still on the school curriculum. It's there because the curriculum is outdated. Hod is lazy nd lecturer is lazy. Theyre all dull nd behind d times. Teach languages tht will help them get their career off,later,if they want to,they can pick up obscure/niche languages.
A friend was thought pascal/fortran (cant remember clearly) during his programme in the early 2000s!
Re: How To Solve A Grade Problem Using A Pascal (lazarus IDE) by airsaylongcon: 11:36pm On Jun 23, 2019
Na wa o! Someone is asking for a simple program in pascal that is a procedural language and someone ias advising him to use OOP in another Language.

Reminds me of the joke were some one who was preparing for an exam in Christian Religious studies was faced with the question "Discuss the life of Jesus Christ". Having studied in detail the life of Apostle Paul, the candidate answered thus

"Who am I to discuss about the life of our Lord and Saviour Jesus Christ! I'd rather discuss about his servant, the Apostle Paul" and he went on a tirade yanning of point.

OP this is actually a simple task. Every Course in university has a "credit" rating (usually between 1 and 4). Also every letter grade has a grade point. For example "A" might have a grade point of 5, B a grade point of 4 all the way to F with a grade point of zero. So to calculate Semester GPA you multiply each course credit rating by the grade point. So if a course has 3 credits and someone scored B in it the grade point will be 3(credit)x4(grade point) to give a grade point of 12. You do this for all courses then add the calculated grade point and divide by the sum of all the credits of the courses. For CGPA you do the same for all courses from year 1 till date.

So for HND 1 Semester 1, you need to list out all the courses, their credits and whatever grade the person scored and calculate the Semester grade point. For Semester 2 you calculate the semester GPA and the cumulative GPA
See the following page for sample. They will need to be modified to suit your needs

https://cs.nyu.edu/courses/spring99/A22.0002.002/lecture_notes/lecture3/node51.html

1 Like

Re: How To Solve A Grade Problem Using A Pascal (lazarus IDE) by stanliwise(m): 11:44pm On Jun 23, 2019
asalimpo:

i know but so are lisp nd ada.
But this isnt d reason it's still on the school curriculum. It's there because the curriculum is outdated. Hod is lazy nd lecturer is lazy. Theyre all dull nd behind d times. Teach languages tht will help them get their career off,later,if they want to,they can pick up obscure/niche languages.
A friend was thought pascal/fortran (cant remember clearly) during his programme in the early 2000s!
Fortran is a recommended language all over the world o. BASIC and FORTRAN has been accepted as teaching standard for programming because of it nice and structural nature, living out abstractions and complexity to professional languages. Another language is pascal due to it clean syntax. Read the last revision of educational curriculum. I studied computer science Education. so this is my job.
Aithough in my opinion teaching using recent technology isn't a bad idea either, as it will enhance productivity, since most mordern languages have vast documentation that supersedes any difficulty one may experience with this languages.
Re: How To Solve A Grade Problem Using A Pascal (lazarus IDE) by airsaylongcon: 11:47pm On Jun 23, 2019
asalimpo:

i know but so are lisp nd ada.
But this isnt d reason it's still on the school curriculum. It's there because the curriculum is outdated. Hod is lazy nd lecturer is lazy. Theyre all dull nd behind d times. Teach languages tht will help them get their career off,later,if they want to,they can pick up obscure/niche languages.
A friend was thought pascal/fortran (cant remember clearly) during his programme in the early 2000s!

Yes Pascal was in the early 2000s. And I agree that the curriculum may be outdated. But I don't believe the problem solving that is involved in this is outdated. What the teacher is teaching here is the problem solving and algorithm development technique. If the OP can develop his own algorithm to solve the problem, it's irrelevant if the final product is in Pascal, Basic, Assembly or Java. All those languages are just a means of expressing the solution. The most important thing is the developed solution.

1 Like

Re: How To Solve A Grade Problem Using A Pascal (lazarus IDE) by airsaylongcon: 11:52pm On Jun 23, 2019
stanliwise:
Fortran is a recommended language all over the world o. BASIC and FORTRAN has been accepted as teaching standard for programming because of it nice and structural nature, living out abstractions and complexity to professional languages. Another language is pascal due to it clean syntax. Don't misinform us here. Read the last revision of educational curriculum. I studied computer science Education. so this is my job.

All these languages are outdated bro. Very outdated. The least language anyone should be learning these days is Java. Procedural Programming is comatose and perhaps dead even (probably only used in niche situations). Every computer science graduate today should be programming using OOP. If you want a standard global CS curriculum as developed by the association of computing machinery (ACM), I can share the link here for you to read. You will be surprised how outdated our local curriculum is. Many of our computer science grads cannot do Big O calculations neither do they understand OS concepts of deadlock and all. Even ordinary BCNF normalisation of database tables a lot don't know

3 Likes

Re: How To Solve A Grade Problem Using A Pascal (lazarus IDE) by stanliwise(m): 11:57pm On Jun 23, 2019
airsaylongcon:


All these languages are outdated bro. Very outdated. The least language anyone should be learning these days is Java. Procedural Programming is comatose and perhaps dead even (probably only used in niche situations). Every computer science graduate today should be programming using OOP. If you want a standard global CS curriculum as developed by the association of computing machinery (ACM), I can share the link here for you to read. You will be surprised how outdated our local curriculum is. Many of our computer science grads cannot do Big O calculations neither do they understand OS concepts of deadlock and all. Even ordinary BCNF normalisation of database tables a lot don't know
procedural language dead ke! you're being affected by news flash. I wouldn't argue that topic with you. I agree and adovcate that recent languages should be taught, the idea that fortran is easy isn't a winning argument anymore because with the help of heavy documentation of new language I believe it will make it easier for students. So personally I prefer the use of new languages in school. With PHP documentation I believe it will be easier than learning BASIC language in modern era.
Also the above you mentioned above isn't really applicable here, almost all Nigerian graduates don't work with their theoretical knowledge. So I guess is the reason for their lackadaisical attitude to learning.

1 Like

Re: How To Solve A Grade Problem Using A Pascal (lazarus IDE) by airsaylongcon: 12:05am On Jun 24, 2019
stanliwise:
procedural language dead ke! you're being affected by news flash. I wouldn't argue that topic with you. I agree and adovcate that recently languages shoulf be taught, the idea that fortran is easy isn't a winning argument anymore because with the help of heavy documentation of new language I believe it will make it easier for students. So personally I prefer the use of new languages in school. With PHP documentation I believe it will be easier than learning BASIC language modern era.

Like you, I also support the use of modern programming languages from the the very beginning. The mindset of learn an "easy" language before learning say Java is very counter intuitive and counter productive.

However, I never said that procedural languages are dead. I said the procedural programming paradigm is comatose bordering on death. Most programming today is done using OOP at least. Procedural programming is mainly used for niche situations.

Nice ideas you have shared on this thread

1 Like

Re: How To Solve A Grade Problem Using A Pascal (lazarus IDE) by asalimpo(m): 9:02am On Jun 24, 2019
airsaylongcon:
Na wa o! Someone is asking for a simple program in pascal that is a procedural language and someone ias advising him to use OOP in another Language.

Reminds me of the joke were some one who was preparing for an exam in Christian Religious studies was faced with the question "Discuss the life of Jesus Christ". Having studied in detail the life of Apostle Paul, the candidate answered thus

"Who am I to discuss about the life of our Lord and Saviour Jesus Christ! I'd rather discuss about his servant, the Apostle Paul" and he went on a tirade yanning of point.

OP this is actually a simple task. Every Course in university has a "credit" rating (usually between 1 and 4). Also every letter grade has a grade point. For example "A" might have a grade point of 5, B a grade point of 4 all the way to F with a grade point of zero. So to calculate Semester GPA you multiply each course credit rating by the grade point. So if a course has 3 credits and someone scored B in it the grade point will be 3(credit)x4(grade point) to give a grade point of 12. You do this for all courses then add the calculated grade point and divide by the sum of all the credits of the courses. For CGPA you do the same for all courses from year 1 till date.

So for HND 1 Semester 1, you need to list out all the courses, their credits and whatever grade the person scored and calculate the Semester grade point. For Semester 2 you calculate the semester GPA and the cumulative GPA
See the following page for sample. They will need to be modified to suit your needs

https://cs.nyu.edu/courses/spring99/A22.0002.002/lecture_notes/lecture3/node51.html


In Nigeria of today, a school is teaching future software engineers to build software using the highly faulted procedural method! I know Fortran was the king in the procedural age but the op is using Lazarus ,a modern Fortran(or is Pascal) ide. The new language is object oriented.
This is simple task for toy examples, but for something that looks like a real world app-though trivial- u have to design it properly to handle more scenarios.
The better paradigm for designing software is pop,hence I showed him how to go about it.
E.g what if the software will b used by some1 else? What if student carries over a course etc

What about code reuse and not repeating oneself? This require using mechanisms like encapsulation,inheritance etc. it seems overkill but I thought that was d level op is at
Re: How To Solve A Grade Problem Using A Pascal (lazarus IDE) by airsaylongcon: 9:20am On Jun 24, 2019
asalimpo:

In Nigeria of today, a school is teaching future software engineers to build software using the highly faulted procedural method! I know Fortran was the king in the procedural age but the op is using Lazarus ,a modern Fortran(or is Pascal) ide. The new language is object oriented.
This is simple task for toy examples, but for something that looks like a real world app-though trivial- u have to design it properly to handle more scenarios.
The better paradigm for designing software is pop,hence I showed him how to go about it.
E.g what if the software will b used by some1 else? What if student carries over a course etc

What about code reuse and not repeating oneself? This require using mechanisms like encapsulation,inheritance etc. it seems overkill but I thought that was d level op is at

Well you have highlighted features that would be nice-to-have. However this is a class assignment with a very specific requirement. Normally after these kind of question the teacher can give "harder" ones for extra mark where you have to cater for the variables you have highlighted.

The first aim for this assignment is to get it to calculate a GP first before adding the complexities that are available in real life.

POP? Please what paradigm is this? First time I'm hearing of it
Re: How To Solve A Grade Problem Using A Pascal (lazarus IDE) by asalimpo(m): 3:25pm On Jun 24, 2019
airsaylongcon:


Yes Pascal was in the early 2000s. And I agree that the curriculum may be outdated. But I don't believe the problem solving that is involved in this is outdated. What the teacher is teaching here is the problem solving and algorithm development technique. If the OP can develop his own algorithm to solve the problem, it's irrelevant if the final product is in Pascal, Basic, Assembly or Java. All those languages are just a means of expressing the solution. The most important thing is the developed solution.
C and Fortran are alive for reasons mainstream languages can't meet. C is blazingly fast and gives u unfettered control of the system. Fortran is. Very fast and has native inbuilt constructs for scientific computing. Basic was very easy to get started programming with. Assembly gives u even more control over d system than c. The problem is older languages had flaws newer languages tried to address.
Pascal nd Fortran were king of spaghetti code writing. C was unwieldy for writing large programs,hence c with classes ,C++ was born. C++ was too complex , you could program in many ways and shoot urself in d foot while doing so. Also memory leak issues plagued languages that allowed direct access to memory so java came along. Java imposed restrictions that limited programmer's power and enforced programmer to code in a particular paradigm -oop. Java took over the world. It is till one of the most successful programming languages ever. Always trending at or near the top of most popular programming languages. The issue then is why should a school/teacher in this modern era resort to teaching students with languages that could engender very bad coding habits that they'll have to unlearn down the road when they are cheaper more modern alternatives specially built to enforce good sound software engineering principles in the user? It doesn't make sense and is outrightly Stu.pid!
How easy is it to get a BASIC language compiler as against getting a java/kotlin/Python compiler/interpreter?
Why would you want some to code using line numbers and in all uppercase today? Is that how professionals code today?
The only reason is laziness and complacency.
Re: How To Solve A Grade Problem Using A Pascal (lazarus IDE) by stanliwise(m): 10:06am On Jun 25, 2019
airsaylongcon:


Yes Pascal was in the early 2000s. And I agree that the curriculum may be outdated. But I don't believe the problem solving that is involved in this is outdated. What the teacher is teaching here is the problem solving and algorithm development technique. If the OP can develop his own algorithm to solve the problem, it's irrelevant if the final product is in Pascal, Basic, Assembly or Java. All those languages are just a means of expressing the solution. The most important thing is the developed solution.
You nailed it

(1) (Reply)

Help! Moving Whatsapp History From Android To New iPhone Without Loosing Anythin / Capturing Image From Webcam Using Java With Jmf.jar / A Simple Signals And Slots Events Mechanism In Java

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 78
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.