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
alex41 [277]
3 years ago
6

(a) Write a program which calculates and displays the obtained marks, percentage in six subjects and assigns grades based on per

centage obtained by a student.
i. if the percentage is above 90, assign grade A
ii. if the percentage is above 75, assign grade B+
iii. if the percentage is above 70, assign grade B
iv. if the percentage is above 65, assign grade C+
v. if the percentage is above 60, assign grade C
vi. if the percentage is above 55, assign grade D+
vii. if the percentage is less than 50, assign grade F
(Hint: using logical operators)
c++ programming
Computers and Technology
1 answer:
dangina [55]3 years ago
5 0

Answer:

The program in C++ is as follows:

#include <iostream>

using namespace std;

int main(){

   int scores[6];

   int sum =0;

   string grade;

   for(int i =0; i < 6; i++){

       cin>>scores[i];

       sum+=scores[i];    }

   double percent = sum/6.0;

   if(percent > 90){        grade ="A";    }

   else if(percent>75){        grade ="B+";    }

   else if(percent>70){        grade ="B";    }

   else if(percent>65){        grade ="C+";    }

   else if(percent>60){        grade ="C";    }

   else if(percent>55){        grade ="D+";    }

   else if(percent<50){        grade ="F";    }

   cout<<grade;

   return 0;

}

Explanation:

This declares the 6 scores using an array

   int scores[6];

This initializes the sum of all scores to 0

   int sum =0;

This declares the grade as string

   string grade;

This iterates through the scores

   for(int i =0; i < 6; i++){

This gets input for each score

       cin>>scores[i];

This adds up the scores

       sum+=scores[i];    }

This calculates the percentage

   double percent = sum/6.0;

The following if statements determine the grade

<em>    if(percent > 90){        grade ="A";    }</em>

<em>    else if(percent>75){        grade ="B+";    }</em>

<em>    else if(percent>70){        grade ="B";    }</em>

<em>    else if(percent>65){        grade ="C+";    }</em>

<em>    else if(percent>60){        grade ="C";    }</em>

<em>    else if(percent>55){        grade ="D+";    }</em>

<em>    else if(percent<50){        grade ="F";    }</em>

This prints the grade

   cout<<grade;

You might be interested in
How would I add a play again function to this code in python?
Sav [38]

Answer: Paper

Explanation:

3 0
3 years ago
How many yards must you run to complete a 100 meter dash?
ddd [48]
103 yards in a 100 meter dash
<span />
4 0
3 years ago
Read 2 more answers
What is the difference between operating systems and application software?
mojhsa [17]

Answer:

The main difference between operating system and application software is that an operating system is a system software that works as the interface between the user and the hardware while the application software is a program that performs a specific task.

Explanation:

5 0
3 years ago
Discuss how classification systems have undergone several changes over a period of time.
katen-ka-za [31]

With time, the classification systems have undergone numerous alterations. Aristotle made the first attempt at classification. He divided plants into three categories: trees, shrubs, and herbs.

On the other side, red blood cell presence or absence was used to categorise animals. The known organisms cannot all be categorised using this technique.

As a result, Linnaeus provided a two-kingdom classification scheme. Kingdom Plantae and kingdom Animalia are its constituent parts. However, this approach did not distinguish between eukaryotes and prokaryotes or between unicellular and multicellular creatures. As a result, there were numerous species that fell outside of the two kingdoms.

Thus, in order to classify the three kingdoms, Ernest Haeckel divided unicellular eukaryotic organisms into a separate kingdom called Protista.

Learn more about classification systems:

brainly.com/question/28391550

#SPJ4

4 0
1 year ago
Write the definition of a function named quadratic that receives three double parameters a, b, c. If the value of a is 0 then th
VMariaS [17]

Answer:

#include <iostream>

#include <cmath>

using namespace std;

//initialize function quadratic

void quadratic(double, double, double);

int main() {

   //declare double variables a, b and c

   double a,b,c;

   //take input from user

   cin>>a>>b>>c;

   //call function quadratic

   quadratic(a,b,c);

return 0;

}

void quadratic(double a, double b, double  c){

   double root,n;

   //check if variable a is equal to zero

   if(a==0){

       cout<<"no solution for a=0"<<endl;

       return;

   }

   //check if b squared - 4ac is less than zero

   else

   if(((b*b)-(4*a*c))<0){

       cout<<"no real solutions"<<endl;

       return;

   }

   //print the largest root if the above conditions are not satisfied

   else{

       n=((b*b)-(4*a*c));

       root=(-b + sqrt(n)) / (2*a);

       cout<<"Largest root is:"<<root<<endl;

   }

   return ;

}

Explanation:

Read three double variables a, b and c from the user and pass it to the function quadratic. Check if the value of variable a is equal to zero. If true, print "no solution for a=0". If this condition is false, check if b squared - 4ac is less than zero. If true, print "no real solutions". If this condition is also false, calculate the largest solution using the following formula:

largest root = (-b + square root of (b squared - 4ac)) / (2*a)

Input 1:

2 5 3

Output 2:

Largest root is:-1

Input 2:

5 6 1

Output 2:

Largest root is:-0.2

5 0
4 years ago
Other questions:
  • A newspaper publishes a negative editorial on how local politicians are dragging their feet in building a new bridge. Select the
    5·2 answers
  • Which Tire would you use to explain a set of phones in an HTML document?
    12·1 answer
  • Choose the list of the best uses for word processing software.
    5·1 answer
  • What are personal skills?
    5·1 answer
  • Which options can be adjusted in the print settings?
    8·2 answers
  • _____ selectors are used to select elements based on elements that are adjacent to them in the document hierarchy.
    9·1 answer
  • Type the correct answer in the box. Spell all words correctly.
    12·2 answers
  • The metric unit used for length
    5·1 answer
  • Do you know how to change your grades on a printer???????????
    13·1 answer
  • Write your question here (Keep it clear and simple to get the best answer)
    13·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!