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
The Mark Table of Contents Entry option is used for marking nonheading text for the table of contents. the options are manually
enyata [817]

Answer:number 1

Explanation:asian culture

5 0
3 years ago
Read 2 more answers
I think my knee....
SIZIF [17.4K]

Answer:

Explanation:

is broken.

4 0
3 years ago
In computing, a(n) _____ is an attack on an information system that takes advantage of a particular system vulnerability. Select
tensa zangetsu [6.8K]

Answer: d) Exploit

Explanation: Exploit is a type computer attack that successful when the computer system of an user is vulnerable and attacker can do the exploitation. This happens due to the weakness of the system, applications software, network etc.

Other given option are incorrect because exit door,glitch and bad are not any type of attack in the computer field that causes harm to the system.Thus the correct option is option(d).

4 0
3 years ago
Before you begin entering data in a worksheet, you should create a _____ for the worksheet.
DIA [1.3K]

Answer:

I'm pretty sure the answer is Template, But if I'm wrong sorry

Explanation:

3 0
3 years ago
Read 2 more answers
Write a definition in your own words for pixel. Do not copy and paste please.
lesya692 [45]

Answer:

Pixel is kind of like a drawing but made differnetly from other drawings that is my guess.

Explanation:

hope this helped

6 0
3 years ago
Read 2 more answers
Other questions:
  • In cell F15, insert a function that will automatically display the word Discontinue if the value in cell D15 is less than 1500,
    6·1 answer
  • What are the diffrent types of contract
    9·1 answer
  • A global project called One Laptop per Child is attempting to distribute low-cost laptop computers to children in developing cou
    10·1 answer
  • The methodology used by web project teams is usually:
    9·1 answer
  • Managers can use __ software to discuss financial performance with the help of slides and charts
    11·1 answer
  • The programming interface for a legacy motor controller accepts commands as binary strings of variable lengths.
    15·1 answer
  • How do i mark answers brainliest on brainly
    11·2 answers
  • Which statement is true concerning user-defined data types?
    10·1 answer
  • To keep files organized, related documents are often stored in ____ (also called directories) located on the storage medium.
    11·1 answer
  • 18. which of these components is responsible for providing instructions and processing for a computer? a. cpu b. ssd c. ram d. r
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!