Write a function float final_grade (float g1, float g2) that counts the grade g1 of Coursework 1 for 20% and the grade g2 of Coursework 2 for 80% and returns the final grade. All grades are in the range 0-100, and the function should print "ERROR\n" and return -1.0 if any of its arguments is outside this range. Answer: (penalty regime: 10, 20, ... %) 1

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter6: User-defined Functions
Section: Chapter Questions
Problem 19PE
icon
Related questions
Question

coding in c 

Write a function float final_grade (float g1, float g2) that counts the grade g1 of Coursework 1 for 20% and the grade g2 of Coursework 2 for 80% and returns
the final grade. All grades are in the range 0-100, and the function should print "ERROR\n" and return -1.0 if any of its arguments is outside this range.
Answer: (penalty regime: 10, 20, ... %)
1
Transcribed Image Text:Write a function float final_grade (float g1, float g2) that counts the grade g1 of Coursework 1 for 20% and the grade g2 of Coursework 2 for 80% and returns the final grade. All grades are in the range 0-100, and the function should print "ERROR\n" and return -1.0 if any of its arguments is outside this range. Answer: (penalty regime: 10, 20, ... %) 1
Expert Solution
steps

Step by step

Solved in 1 steps with 3 images

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr