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
Select each of the strategies you can use to be more efficient when using the Internet. using tabs creating tables creating book
xeze [42]
Using tabs creating tables creating bookmarks &
<span>deleting bookmarks you are no longer using organizing bookmarks into folders
</span>
<span />
6 0
2 years ago
Read 2 more answers
What are the steps to creating a blank database? Use the drop-down menus to complete them.
Alenkasestr [34]

Answer:

What are the steps to creating a blank database? Use the drop-down menus to complete them.

click the file tab, and click new

Under the available Templates category, click Blank Database.

Specify a name and location for the database.

Click create.

Explanation:

Just did it on Edge :)

5 0
2 years ago
Write a program which:
Studentka2010 [4]

Answer:

Ill do this in C# and Java

Explanation:

C#:

public static void Main(string[] args)

       {

           string input = Console.ReadLine();

               switch (input)

               {

                   case "A1":

                       Console.WriteLine("Footwear:");

                       Console.WriteLine("Shoes");

                       break;

                   case "B1":

                       Console.WriteLine("Tops:");

                       Console.WriteLine("Jackets");

                       break;

                   case "C1":

                       Console.WriteLine("Pants:");

                       Console.WriteLine("Trousers");

                       break;

                   case "A2":

                       Console.WriteLine("Footwear:");

                       Console.WriteLine("Trainers");

                       break;

                   case "B2":

                       Console.WriteLine("Tops:");

                       Console.WriteLine("TShirts");

                       break;

                   case "C2":

                       Console.WriteLine("Pants:");

                       Console.WriteLine("Shorts");

                       break;

                   default:

                       Console.WriteLine("Incorrect Input");

                       break;

               }

       }

Java:

public static void main(String[] args)

   {

       Scanner myObj = new Scanner(System.in);  // Create a Scanner object

       String input = myObj.nextLine();

       {

           switch (input)

               {

                   case "A1":

                       System.out.println("Footwear:");

                       System.out.println("Shoes");

                       break;

                   case "B1":

                       System.out.println("Tops:");

                       System.out.println("Jackets");

                       break;

                   case "C1":

                       System.out.println("Pants:");

                       System.out.println("Trousers");

                       break;

                   case "A2":

                       System.out.println("Footwear:");

                       System.out.println("Trainers");

                       break;

                   case "B2":

                       System.out.println("Tops:");

                       System.out.println("TShirts");

                       break;

                   case "C2":

                       System.out.println("Pants:");

                       System.out.println("Shorts");

                       break;

                   default:

                       System.out.println("Incorrect Input");

                       break;

               }

       }

3 0
3 years ago
You just read a restaurant review on the internet of the newest restaurant in town. The writer of the article said the food was
Marizza181 [45]
A. The restaurant review contains data but is not data itself. 
I'm sorry if that's wrong, but that seems right to me. 

6 0
3 years ago
If you want to adjust the width of a column manually, move your mouse over the _______ column boundary and click and drag until
Luda [366]

Answer:

The answer is "Right".

Explanation:

In computer science, editing is the primary activity, which is used by the users to handles graphics, tables, and other things. It can be divided into two types first is internal(default) and the second is manual.

  • In the manual editing, to edit the column of the table we just right click on the column.
  • It enables you to edit option, in which we edit column according to our desire.
6 0
3 years ago
Other questions:
  • Your friend is working on fixing their Homework assignment. They need a lot of help. You know all the bugs in the file, but due
    12·1 answer
  • Your assignment is to write an assembly language program which read a string and print it in uppercase. This program asks the us
    15·1 answer
  • Of which of the following devices are point, drag, and click actions?
    15·1 answer
  • PLEASE PLEASE PLEASE PLEASE PLEASE HELP! I'M BEGGING Y'ALL! I NEED THIS FOR TODAY! CORRECT ANSWERS WILL BE AWARDED BRAINLIEST!
    6·1 answer
  • What are styles? built-in conditional formatting rules formatting applied with the Format Painter defined combinations of format
    15·2 answers
  • What are some common uses of Excel?
    10·1 answer
  • A list is sorted in ascending order if it is empty or each item except the last one is less than or equal to its successor.
    14·1 answer
  • Suppose you are working as an administrative assistant at a small law firm. Your boss has asked you to send an invitation out to
    5·1 answer
  • Heeeeeeeeeeeeeeeeeeeeeeeeelp pat.2
    12·1 answer
  • Common names for computer-based information systems are transaction processing, management information, ________, and executive
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!