0

It's running but It just says press any key to continue. What is wrong with my code?

Write  a  program  that  prompts  the  learner  to  key  in  their  marks  for  each  subject.    The  program  should include  the  following  functions: a.    A  function  studentDetails, that  prompts  the  learner  to  key  in  their  personal  details name,surname,   and  schoolName.  b.   (3) A  function  getMarks, that  prompts  the  learner  to  key  in  a  mark  for  each  of  the  six  subjects,  and validate  the  marks.  Do  not  accept  marks  lower  than  0  or  higher  than  100.  (3) c.    d.   A  function  calcAverageYearMark, to  calculate  and  display  the  average  of  the  6 Subjects.  This function  should  be  called  just  once  by  main,  and  should  be passed  the  6  Subject  marks.  (6) A  function  minMax,  to  find  and  return  the  lowest   and  the  highest  of  the  6  subject  marks passed  to  it  as  the  subject  with  the  lowest  mark;  e. A function passOrFail, to determine whether the student has passed or failed grade 12.   (9)  f. A function awardDistinction to

23rd Sep 2018, 10:05 PM
Perican Bongani Sithole
Perican Bongani Sithole - avatar
13 Respuestas
+ 2
R_Defao is that your homework?
23rd Sep 2018, 10:08 PM
Ulisses Cruz
Ulisses Cruz - avatar
23rd Sep 2018, 10:07 PM
Perican Bongani Sithole
Perican Bongani Sithole - avatar
0
Did you see the Code?
23rd Sep 2018, 10:08 PM
Perican Bongani Sithole
Perican Bongani Sithole - avatar
0
Oh I'm sorry I did not see the code
23rd Sep 2018, 10:11 PM
Ulisses Cruz
Ulisses Cruz - avatar
0
It's the link below the question statement
23rd Sep 2018, 10:13 PM
Perican Bongani Sithole
Perican Bongani Sithole - avatar
0
Your code has many issues. (Don't be discoraged.) Let's start with the function studentDetails: - You are passing the name, surname and schoolName as parameters, but then you are asking the user for them inside the function body. You should do either one or the other. - You are asking the user for its name then you are returning from the function. This means the rest of the code inside the function will not run. Fix those issues, after that I'll continue.
23rd Sep 2018, 10:28 PM
Ulisses Cruz
Ulisses Cruz - avatar
0
To fix the first issue: - I understand why you are passing the parameters. - Instead of returning, assign those values to the variables. use the 'cin'
23rd Sep 2018, 10:32 PM
Ulisses Cruz
Ulisses Cruz - avatar
0
Thanks man. If you notice something else please tell me
23rd Sep 2018, 10:36 PM
Perican Bongani Sithole
Perican Bongani Sithole - avatar
0
Here is some changes I made to your code: https://code.sololearn.com/cPmgj3vLPehk/?ref=app
23rd Sep 2018, 11:23 PM
Ulisses Cruz
Ulisses Cruz - avatar
0
There are still some changes that need to be made.
23rd Sep 2018, 11:25 PM
Ulisses Cruz
Ulisses Cruz - avatar
0
What changes are ?
24th Sep 2018, 7:06 AM
Perican Bongani Sithole
Perican Bongani Sithole - avatar
0
I'm starting to see my way through, the first three functions are working now. Thanks man, your comments makes a big difference in my work.!
24th Sep 2018, 3:25 PM
Perican Bongani Sithole
Perican Bongani Sithole - avatar
0
I'll keep in touch with you
24th Sep 2018, 3:26 PM
Perican Bongani Sithole
Perican Bongani Sithole - avatar