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
Adam is evaluating the security of a web server before it goes live. He believes that an issue in the code allows an SQL injecti
givi [52]

The term vulnerability describes the issue that Adam discovered.

b. vulnerability

<u>Explanation:</u>

SQL injection attack is an attack in which an external party can execute SQL commands on the database that serves as a back-end for a particular website. The SQL commands can be used to modify the contents of the website, modify the records, delete the records, and retrieve confidential information as well.  

As Adam believes that the code has an issue that allows a SQL injection attack, the term that best describes the issue that he discovered is vulnerability. The website is vulnerable since the code does not have a proper procedure to tackle a situation of SQL injection attack.

7 0
3 years ago
Suppose that a machine with a 5-stage pipeline uses branch prediction. 15% of the instructions for a given test program are bran
zhenek [66]

Answer:

solution attached below

Explanation:

3 0
3 years ago
As a digital strategist, Jared wants to add something extra to his ads to give users more incentive to click and convert. He's c
nadya68 [22]

Answer:

A) Up to 15 characters in each.

Explanation:

Total characters he can use in each of these optional paths are up to 15 characters in each.

6 0
3 years ago
Explain block diagram of. computer architure​
ozzi

Answer:

A block diagram is a diagram of a system in which the principal parts or functions are represented by blocks connected by lines that show the relationships of the blocks. They are heavily used in engineering in hardware design, electronic design, software design, and process flow diagrams.

Explanation:

In your question you asked architure but maybe it is architecture (•;

5 0
2 years ago
Jan pays $70 each month for her auto insurance policy . The regular payment is called a
olga nikolaevna [1]
The amount paid regularly for insurance is called the premium.
3 0
3 years ago
Other questions:
  • ________ is a method for addressing, creating, updating, or querying relational databases.
    9·1 answer
  • A(n) file management system is a program that allows the creation of individual database tables, each of which is stored in its
    5·1 answer
  • Which of the following are types of home internet service? Check all that apply
    7·1 answer
  • Python provides a special version of a decision structure known as the ________ statement, which makes the logic of the nested d
    13·1 answer
  • To discover how many cells in a range contain values that meet a single criterion, use the ___ function
    5·1 answer
  • Hurry please i need this ASAP<br><br>What might be some advantages to keeping CSS and HTML separate?
    8·1 answer
  • 0111101101010110101110110001001011101001011101101010101010110101
    14·1 answer
  • Requests to retrieve data written in a language such as SQL are called…
    8·1 answer
  • We can find out how robots work by looking in detail at the smaller parts. What do we call this?
    6·1 answer
  • How to get an object from a container in java.
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!