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
You have a website that sells widgets, and you have a category page specifically for blue widgets. After some extensive outreach
REY [17]

Answer:

It will increase your ranking on the homepage.

Explanation:

Widgets are easy to use software applications made up of one or more components.

Widgets will provide you with a quick access to information or data and there won't be any need to open the app that manages that information.

That is to say, without requiring you to open the app that manages a certain data or information you want to access, Widgets opens it for you.

For instance, The Calendar widget, provides you a quick view of your upcoming calendar events without opening the Calendar app.

Your rankings on the homepage will increase if more links are added to your blue widgets.

7 0
3 years ago
Which property describes if a mineral breaks down into flatpieces​
marta [7]

Answer: Cleavage

Explanation:

3 0
3 years ago
5) Write a regular expression would zip code + 4 fields of the forms: xxxxx-xxxx where x is any number but the last 4 digits cou
marusya05 [52]

Answer:

Following is the expression written in "Bash script" (mixture of commands):

^\d{5}(?:[-\s]\d{4})?$

Explanation:

  • ^ = For staring string (denotation).
  • \d{5} = Matching 5 digits (first five unknown x's)
  • (?:…) = Making Group (making group of former 5 digits)
  • [-\s] = Match a hyphen  or a space

                 (checking if a hyphen is present?)

  • \d{4} = Matching 4 digits (next four unknown x's)
  • …? = Pattern before it is optional
  • $ = Ending of the string.(denotation)

4 0
3 years ago
Which of the following statements is NOT correct?
Ainat [17]

Answer: B)  Pseudocode should be properly formatted.

Explanation:

 Pseudocode is defined as in the informal description of the given sequence, there is no need that it should be formatted properly. There is no such restriction required in the pseudocode as they are read by the humans not by the computer programs.

Pseudocode should be terminating, executable and unambiguous and it uses structural convention of the programming language rather than using machine reading.

4 0
3 years ago
What is a Hyperlink. Give three characteristics of a hyperlink ​
Vitek1552 [10]

Answer:

link destination ("href" pointing to a URL)

link label.

link title.

link target.

link class or link id.

Explanation:

4 0
3 years ago
Read 2 more answers
Other questions:
  • Three periods after a menu item (...) mean that clicking that command will open
    15·2 answers
  • str1=”Good” str2=”Evening” Does the concatenation of the above two strings give back a new string or does it concatenate on the
    14·1 answer
  • What are the answers to everfi
    5·1 answer
  • Fair Use means a teacher can take the contents of a web activity page and repost it in your school's web site because it is for
    7·1 answer
  • Which type of electronic payment is typically favored in b2b?
    5·1 answer
  • You work in an office that uses Linux servers and Windows servers. The network uses both the TCP/IP protocol. The Linux server i
    11·1 answer
  • You are studying for a test tomorrow. Your friends invite you to
    12·1 answer
  • Which is the correct notation to specify the following inheritance?
    8·1 answer
  • What is intellectual property rights law ?​
    8·1 answer
  • Fill in the blank with the correct response.
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!