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]
2 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]2 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
Gregory Yob is associated with which of these games?
DiKsa [7]

Answer:

Gregory Yob is associated with Hunt the Wumpus.

Explanation:

Hunt the Wumpus was developed in 1973 by Gregory Yob and was one of the first games where the player can move around a series of interconnected controls.

please mark brainliest it really helps :)

3 0
3 years ago
Read 2 more answers
To have different formatting for odd and even rows, select the _____ option.
Ratling [72]
<span>To have different formatting for odd and even rows, 
The option is </span><span>First Column</span>
4 0
3 years ago
The basic components of cartridges and shotshells are similar. Shot pellets and a bullet are examples of which basic component?
Liono4ka [1.6K]
The answer is projectile. Handguns and rifles use a cartridge having a single projectile or bullet. Shotguns use a shot shell comprising either a single bullet or a big number of small projectiles (shot or pellets). Though, the basic components of cartridges and shot shells are alike.
5 0
3 years ago
Professor Gig A. Byte needs to store text made up of the characters A with frequency 6, B with frequency 2, C with frequency 3,
Luden [163]

Answer:

This is not true

Explanation:

The optimal Huffman code is used to encrypt and compress text files. It uses fixed-length code or variable-length code for encryption and compression of data.

The professor's character code is similar to Huffman's variable-length coding which uses variable length od binary digits to represent the word strings. The file size of the text file above is;

= 6 x 1 + 2 x 2 + 3 x 2 + 2 x 2 + 8 x 1 = 28 bits

This would be the same for both cases.

The encrypt would be the problem as the encoded and decoding of the characters B and E may cause an error.

8 0
2 years ago
In the excerpt above, what can be inferred by the statement, “The Dillingham had been flung to the breeze during a former period
galina1969 [7]
The best and the most correct answer among the choices provided by the question is the first choice. We can infer from the excerpt that <span>Jim felt important enough to place his full name on the mailbox when he enjoyed a higher income. </span>I hope my answer has come to your help. God bless and have a nice day ahead!
3 0
3 years ago
Read 2 more answers
Other questions:
  • You can encrypt individual files, but microsoft recommends encrypting at what level?
    9·1 answer
  • The name of a person their address and their contact information like phone number and email address or consider the minimum inf
    9·1 answer
  • in java Write a program with total change amount in pennies as an integer input, and output the change using the fewest coins, o
    13·1 answer
  • What settings are available in the Properties dialog box of a message? Check all that apply.
    6·2 answers
  • HURRY
    8·1 answer
  • In this unit, you developed your skills at coding in Python. In this lab, you will put those skills to work by creating a progra
    8·2 answers
  • What part of the meat help you identify the less tender cuts​
    13·1 answer
  • Another term for the plot structure of the hero journey
    13·1 answer
  • A(n) ____________________ key is a key that is not reused, but rather is only used once, thus improving security by reducing the
    5·1 answer
  • failed logins or instances of denial of access to restricted files may be indicators of compromise. suggest where records of suc
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!