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
Viktor [21]
3 years ago
10

Consider the following table used for grading assignments.

Computers and Technology
1 answer:
xxTIMURxx [149]3 years ago
7 0

Answer:

We can use if-else statements to implement the given problem.

C++ Code:

#include <iostream>

using namespace std;

int main()

{

   int marks;

   cout<<"Enter the marks"<<endl;

   cin>>marks;

  if (marks>=90 && marks<=100)

  {

cout<<"Grade: A"<<endl;

  }

else if (marks>=80 && marks<=89)

{

cout<<"Grade: B"<<endl;

}

else if (marks>=70 && marks<=79)

{

cout<<"Grade: C"<<endl;

}

else if (marks>=60 && marks<=69)

{

cout<<"Grade: D"<<endl;

}

else if (marks>=0 && marks<=59 )

{

cout<<"Grade: F"<<endl;

}

else

{

cout<<"Invalid marks!"<<endl;

}

   return 0;

}

Test results:

Enter the marks

100

Grade: A

Enter the marks

90

Grade: A

Enter the marks

89

Grade: B

Enter the marks

80

Grade: B

Enter the marks

79

Grade: C

Enter the marks

70

Grade: C

Enter the marks

69

Grade: D

Enter the marks

60

Grade: D

Enter the marks

59

Grade: F

Enter the marks

45

Grade: F

Enter the marks

105

Invalid marks!

Enter the marks

-6

Invalid marks!

Hence all the cases are working fine!

You might be interested in
What is being measured using kbps, mbps, and gbps?
spayn [35]
Transfer rate.
/////////////////////

8 0
4 years ago
What happened to China and India after they modernized their workforces by providing more training and education?
dem82 [27]
The correct answer is D.
5 0
2 years ago
How does a computer work
ivann1987 [24]

Answer:

computer works on electricity

Explanation:

6 0
3 years ago
Implement one array of the English alphabet (26 characters). a) Create a function, getLetters() to cast and generate the array.
WARRIOR [948]

#include <fstream>

#include <iostream>

#include <iomanip>

#include <cstring>

#include <cstdlib>

using namespace std;

// Function Declarations

void display(char alphabets[],int MAX_SIZE);

void reverse(char alphabets[],int MAX_SIZE);

void swap(char &ch1,char &ch2);

int main() {

 //Declaring constant

const int MAX_SIZE=26;

 

//Declaring a char array

char alphabets[MAX_SIZE];

 

//Populating the array with alphabets

for(int i=0;i<MAX_SIZE;i++)

{

 alphabets[i]=(char)(65+i);

 }

 

 cout<<"Original: ";

 display(alphabets,MAX_SIZE);

 reverse(alphabets,MAX_SIZE);

 cout<<"Reversed: ";

 display(alphabets,MAX_SIZE);

 return 0;

}

//This function will display the array contents

void display(char alphabets[],int MAX_SIZE)

{

 for(int i=0;i<MAX_SIZE;i++)

 {

    cout<<alphabets[i]<<" ";

 }

 cout<<endl;

}

//This function will reverse the array elements

void reverse(char alphabets[],int MAX_SIZE)

{

 int first,last;

 first=0;

 last=MAX_SIZE-1;

 

 while(first<last)

 {

   

    swap(alphabets[first],alphabets[last]);

    first++;

    last--;

   

 }

}

void swap(char &ch1,char &ch2)

{

 char temp;

 temp=ch1;

 ch1=ch2;

 ch2=temp;

6 0
2 years ago
Primary storage is electronic storage connected directly to the CPU. true or false​
Helen [10]

Answer:

I think it's true

Explanation:

I don't know but If I'm wrong tell me?

7 0
2 years ago
Other questions:
  • Designing the moving parts of a car—including the engine, drivetrain, steering, and brakes—is done by what type of engineer?
    11·2 answers
  • Does anyone have the problem where you try to watch a video to get your answer but it brings up a thing asking your gender to ma
    6·1 answer
  • Moderate changes to existing processes falls under the _________ analysis. Business Process Automation (BPA) Business Process Im
    5·1 answer
  • What's a sentence with the words trickle and resume in it? they can be in any tense. Thanku​
    5·1 answer
  • If two hosts are connected by five networks, how many frames will there be when one host sends a packet to the other host? 1 2 5
    13·1 answer
  • You are a network engineer tasked with performing a site survey for a multiple-channel architecture (MCA) system in a three-stor
    11·1 answer
  • Suppose that a 2M x 16 main memory is built using 256kB x 8 RAM chips and memory is word addressable, how many RAM chips are nec
    6·1 answer
  • 7. Which cipher is based on the clues of the physical factors, rather than the hardware or a software cryptosystem
    8·1 answer
  • Match the TCP/IP Layer to a problem that can happen there.
    8·1 answer
  • the ghost adventures team uses a variety of tools and technology in investigations. which one is described as an adjustable freq
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!