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
Assoli18 [71]
3 years ago
9

Rita is writing a C++ programe in whic, she wants to display the grades (stored in variable grade) as per the table of marks (st

ored in variable marks) given below: A – 90-100 B – 80-89 C – 70-79 D < 70
Computers and Technology
1 answer:
qwelly [4]3 years ago
7 0
#include <iostream>
#include <vector>
using namespace std;

class Student
{
public:    
    Student(int mark)    
    {        
        this->mark = mark;

        if (mark >= 90 && mark <= 100)
            grade = 'A';
        else if (mark >= 80 && mark <= 89)            
            grade = 'B';
        else if (mark >= 70 && mark <= 79)
            grade = 'C';
        else if (mark < 70 && mark >= 0)
            grade = 'D';
        else
            cout << "Invalid mark, grade not assigned";
    }

    int getMark()
    {
        return mark;
    }

    char getGrade()
    {
        return grade;
    }

private:
    int mark;
    char grade;
};

int main()
{
    vector<Student> students;
    int num, mark;

    cout << "Enter number of students: ";
    cin >> num;

    if (num <= 0)
        cout << "Invalid number of students, exiting";
    else
    {
        for (int i = 1; i <= num; i++)
        {
            cout << "Enter marks for student " << i << ": ";
            cin >> mark;

            Student s(mark);
            students.push_back(s);
        }
    }

    // do whatever you like with the vector from here onwards, such as:
    /*
    for (int i = 0; i < students.size(); i++)
    {
        cout << "Student " << i + 1 << " grade: " << students[i].getGrade() << endl;
    }
    */

    return 0;
}
You might be interested in
Explain the following terms <br><br>copyleft:<br><br>creative Commons:<br><br>GNU/GPL:​
Serga [27]

Answer:

Explanation:

copyleft:

Copyleft is the practice of granting the right to freely distribute and modify intellectual property with the requirement that the same rights be preserved in derivative works created from that property.

<h2>creative Commons:</h2><h3>Creative Commons (CC) is an internationally active non-profit organisation that provides free licences for creators to use when making their work available to the public. These licences help the creator to give permission for others to use the work in advance under certain conditions. </h3><h3> </h3><h3>Every time a work is created, such as when a journal article is written or a photograph taken, that work is automatically protected by copyright. Copyright protection prevents others from using the work in certain ways, such as copying the work or putting the work online. </h3><h3> </h3><h3>CC licences allow the creator of the work to select how they want others to use the work. When a creator releases their work under a CC licence, members of the public know what they can and can’t do with the work. This means that they only need to seek the creator’s permission when they want to use the work in a way not permitted by the licence. </h3><h3> </h3><h3>The great thing is that all CC licences allow works to be used for educational purposes. As a result, teachers and students can freely copy, share and sometimes modify and remix a CC work without having to seek the permission of the creator</h3><h3>3. GNU/GPL:​</h3>

GPL is the acronym for GNU's General Public License, and it's one of the most popular open source licenses. Richard Stallman created the GPL to protect the GNU software from being made proprietary. It is a specific implementation of his “copyleft” concept.

Software under the GPL may be run for all purposes, including commercial purposes and even as a tool for creating proprietary software, such as when using GPL-licensed compilers. Users or companies who distribute GPL-licensed works (e.g. software), may charge a fee for copies or give them free of charge.

<h3 />
3 0
3 years ago
Which scenario describes a student citing an online source in his or her work?
dimaraw [331]

Answer:

D Ling includes the name of a source’s author in her report.

Explanation: just use it lol

4 0
3 years ago
Read 2 more answers
If you need to set up direct deposit, which information from your check would you likely need?
scoray [572]
The bank routing number and checking account number will be needed.
5 0
3 years ago
Which of the following describes evolution in the SDLC model?
stira [4]

Completing the requirements analysis is the evolutionary step of the Software development life cycle (SDLC). Hence option 3

<h3>What is the software development life cycle?</h3>

The SDLC is a method for evaluating and improving the development process. It enables a fine-grained study of each process phase. As a result, firms are able to maximize efficiency at each level.

SDLC aids in the achievement of these objectives by detecting inefficiencies and increased costs and resolving them so that everything runs smoothly.

Thus, Initial needs and architecture planning must be completed and are considered as an evolution in the SDLC model

Learn more about SDLC:

brainly.com/question/26366977

#SPJ1

4 0
2 years ago
A business letter is not written:
Andreas93 [3]

Answer: the answer is b

Explanation:Bc why would they make a business letter 2 someone else

5 0
3 years ago
Other questions:
  • Write a Python program that will take as input 5 integer values and will output the average of the odd values and the average of
    6·1 answer
  • Import java.util.scanner; public class sumofmax { public double findmax(double num1, double num2) { double maxval; // note: if-e
    10·1 answer
  • Which building-block feature is available in the Text grouping on the Insert tab?
    14·1 answer
  • What options does the business user have to manually share individual records? A new custom object is being created with a priva
    10·1 answer
  • Handouts are pages of your presentation that you print and distribute to your audience
    10·1 answer
  • A field is _____. a complete entry in a database one of the categories in a database a group of twenty-seven records a cell in a
    8·1 answer
  • sunglasses sunglasses sunglasses sunglasses sunglasses sunglasses sunglasses sunglasses sunglasses sunglasses i am a failure sun
    7·2 answers
  • In what tab can a user find the workspace option?
    8·1 answer
  • What is another name for repetition in programming?
    11·1 answer
  • Global communication and transportation technologies are an example of a(n) ____
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!