Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / NewStats: 3,148,298 members, 7,800,507 topics. Date: Wednesday, 17 April 2024 at 07:22 PM |
Nairaland Forum / Science/Technology / Programming / Pls Need Help On This Assignment (1507 Views)
Help With This Assignment Please.. / Hello Programmers, Please I Need You Help With This Assignment / Please Help Me With This Assignment (2) (3) (4)
Pls Need Help On This Assignment by geosvic: 3:06pm On May 08, 2016 |
Pls I need help on these pascal questions. 1. A pascal program that takes the score of 10 courses and calculate the GPA. 2. A pascal program which accepts the size of heart and output heart(love shape) stars on the screen. Using nested loop. Thanks in advance |
Re: Pls Need Help On This Assignment by Fulaman198(m): 5:01pm On May 08, 2016 |
For problem 1, what I would do is initiate a total to 0, then build an array of 10 scores. Iterate through that array of 10 scores and each time the for loop goes through its phase the value of total is increased or added onto by one of the array score elements. After the loop, the total value can be divided by the size or number of elements in the array. |
Re: Pls Need Help On This Assignment by Fulaman198(m): 5:03pm On May 08, 2016 |
For problem 2 are you saying the programme asks the user for a certain amount of asterisks and then outputs them to the screen in the form of a heart? |
Re: Pls Need Help On This Assignment by tr3y(m): 10:58pm On May 08, 2016 |
Fulaman that's not the way to calculate CGPA! OP Google is your friend. You can even see already written code and port it to pascal. |
Re: Pls Need Help On This Assignment by Fulaman198(m): 1:26am On May 09, 2016 |
tr3y: oops lol you are right, I was thinking he was talking about score average, and not CGPA lol my mistake. |
Re: Pls Need Help On This Assignment by Dlastofmykind(m): 1:58am On May 09, 2016 |
Using any programming language, you may not necessarily need an array. If the number of courses is undetermined, Ask the user to input the number of courses he is offering that semester. Declare a variable to be accumulating the points of each of the courses. Initialize the variable to 0 (zero) Declare a variable to be accumulating the units of each of the courses. Initialize the variable also to 0 (zero) Loop through the number of courses. For each of the courses, ask the user to input his score and the units of that course. Calculate the points of each course using the following illustration. Depending on the grade system of your school, Some schools like UI operates on a grade system of 7.0 and you must have a minimum of 70 marks per each course for you to have an A in a course, schools like most polytechnics operates on a grade point of 4.0 (except The Polytechnic, Ibadan, which uses 5.0) and you must have 75 upwards for you to have an A in a course, while others schools operates on a grade point of 5.0 and you must have a minimum of 70 for you to have an A in a course. So, the next thing to do is to use if statements to get the range of each point per course. Take for instance, if your school operates on a grade system of 5.0 and you must have at least 70 to have an A in any course, then your if statements can look like this if(score>=70) { grade = 5.0; point = grade*unit; total_point+=point; total_unit+=unit; } else if( (score>=65) && (score < 70) ) { grade = 4.5; point = grade*unit; total_point+=point; total_unit+=unit; } Then you terminate the loop and then calculate the GP for that semester by using something like gradePoint = total_point/total_unit. I guess that's all |
Re: Pls Need Help On This Assignment by geosvic: 10:29am On May 09, 2016 |
Thanks plenty plenty... Pls how about the heart program Dlastofmykind:Thanks plenty plenty... Pls how about the heart program |
(1) (Reply)
Web Form That's Submitted To An Email Address / Course To Teach Me Software Development And Database Management / Creating Mobile Apps As A Tool For Creating More Job In Nigeria
(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. 21 |