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
Choose the answer that best completes the
Fiesta28 [93]

Answer:

the information processing cycle

Explanation:

3 0
2 years ago
Read 2 more answers
Write a program to compute the maximum and minimum value of three numbers:
nexus9112 [7]

Answer:

in javascript:

function compute(a, b, c){

let array = [a, b, c];

array.forEach((e,k) => {

if(e >= a && e >= b && e >= c){

console.log("maximum: " + e);

}  

if( e <= a && e <= b && e <= c){

console.log("minimum: " + e);

}

}

}

Explanation:

7 0
3 years ago
Why did it take fewer 1-inch tiles than 1-centimeter tiles to measure the length of the cookie cutter?​
Romashka-Z-Leto [24]

The inch tiles are larger, meaning they use less space.

6 0
3 years ago
Sdq1fdszgdSHTGafeges'
kumpel [21]

Answer:

iooooooooooooooooooooo

Explanation:

ooooooooooooooo

oooo9ooooo9oooooooooo

ooooooooooooooppppooooooooooo

oooooooooooo

ooooooooooooooooooooo

6 0
2 years ago
What is output by the following?<br><br>print (type("95"))
statuscvo [17]

Answer:

The output is "<class 'str'> ".

Explanation:

In the given python code a print() function is defined. Inside this function, a type() function will use, in which a numeric value is passed in the double quotes (" ") as a function parameter. Double quotes are normally used for print value as a message but in this code, value is not printed because we use the type() function.

  • The type() function Returns the parameter class type of the argument(object).
  • This function is used for debugging. In this function, we pass a single parameter that will return the type of given object.
6 0
3 years ago
Other questions:
  • 7. The penalties for a first-time DUI charge include a fine of __________. A. up to $500 for a BAL of .08 to .15 B. $500-$1,000
    5·1 answer
  • Which hardware component is most suspect if a user can barely make out
    10·1 answer
  • which of these describe raw data?check all of the boxes that apply A) what a person buys B) where a person lives C) data that ha
    9·1 answer
  • Which table attributes would this code produce?
    15·1 answer
  • Linda subscribes to a cloud service. The service provider hosts the cloud infrastructure and delivers computing resources over t
    10·1 answer
  • List the step in turning on a computer
    6·1 answer
  • Overlay analysis is ____________, taking in data from two or more layers to create a single output layer.
    5·1 answer
  • PLEASE HELP ASAP!!! 99 POINTS FOR 3 MULTIPLE CHOICE QUESTIONS!!! PLEASE ANSWER ALL!!!
    8·1 answer
  • Help me!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!​
    9·1 answer
  • Which of the following tabs on the Ribbon contains the command to add a Quick Part to a document? A Design B Insert C View D Hom
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!