1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
blsea [12.9K]
4 years ago
7

B. Write a function that takes one double parameter, and returns a char. The parameter represents a grade, and the char represen

ts the corresponding letter grade. If you pass in 90, the char returned will be ‘A’. If you pass in 58.67, the char returned will be an ‘F’ etc. Use the grading scheme on the syllabus for this course to decide what letter to return.
Computers and Technology
1 answer:
9966 [12]4 years ago
3 0

Answer:

#include <iostream>

#include <cstdlib>

using namespace std;

char grade(double marks){

   if(marks>=90)

   {

       return 'A';

   }

   else if (marks >=80 && marks<90)

   {

       return 'B';

   }

   

   else if (marks >=70 && marks<80)

   {

       return 'C';

   }

   

   else if (marks >=60 && marks<70)

   {

       return 'D';

   }

     else if ( marks<60)

   {

       return 'F';

   }

}

int main()

{

   double marks;

cout <<"Ener marks";

cin >>marks;

char grd=grade(marks);

cout<<"Grae is "<<grd;

return 0;

}

Explanation:

Take input from user for grades in double type variable. Write function grade that takes a parameter of type double as input. Inside grade function write if statements defining ranges for the grades. Which if statement s true for given marks it returns grade value.

In main declare a variable grd and store function returned value in it.

You might be interested in
What number is needed to complete the pattern 66, 73, 13, 21, 52,_, 10, 20?
Lilit [14]
66,73 73-66=7
13,21 21-13=8
10,20 20-10=10

the missing no. is 9 so
52+9=61.

the pattern is
66,73,13,21,52,61,10,20





8 0
3 years ago
Who wants to join my team that goes against bullying?
weeeeeb [17]
I would be glad to. :D
6 0
4 years ago
Insurance can help you:
seraphim [82]
Yes insurance can help you
3 0
3 years ago
Read 2 more answers
How many comparisons will be made to find 8 in this list using a linear search?
Kobotan [32]

Answer:

4

Explanation:

4

6 0
3 years ago
This is the question
nikdorinn [45]

Answer:

I dont know it sorry

Explanation:

i would help u

4 0
3 years ago
Other questions:
  • What technique creates different hashes for the same password? ccna routing protocols final answers?
    7·1 answer
  • ____ is typically used with lans that have a star topology and can be used in conjunction with twisted-pair, coaxial, or fiber-o
    12·1 answer
  • Assume the existence of a Bank Account class. Define a subclass, Savings Account that contains the following: a double instance
    5·1 answer
  • The computer mouse is used to
    11·1 answer
  • Conduct online research and provide some guidelines on how to secure a web browser. (CyberSecurity plato)
    10·1 answer
  • What is a set of javascript statements that result in an action?
    15·1 answer
  • Which of the following is the most reliable way to check the accuracy of a website?
    13·1 answer
  • Give an essay on a way I can be a better person. If not correct I will refund. Best answer gets brainiest. Detailed, 5 sentience
    10·2 answers
  • What is the output for the following program?
    6·2 answers
  • Brianna is feeling overwhelmed by the amount of digital
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!