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
nirvana33 [79]
2 years ago
9

In c++

Computers and Technology
1 answer:
Elodia [21]2 years ago
5 0

Answer:

class studentType: public personType

{

public:

virtual void print() = 0;

virtual void calculateGPA() = 0;

void setID(long id) {

studentId = id;

}

void setCourses(const string c[], int noOfC) {

noOfCourses = noOfC;

for (int i=0; i<noOfCourses; i++) {

courses[i] = c[i];

}

}

void setGrades(const char cG[], int noOfC) {

noOfCourses = noOfC;

for (int i=0; i<noOfCourses; i++) {

coursesGrade[i] = cG[i];

}

}

long getID() {

return studentId;

}

string* getCourses() {

return courses;

}

char* getGrades() {

return coursesGrade;

}

studentType(string fName = "", string lastName = "",

long id = 0, string c[] = NULL, char cG[] = NULL, int noOfC = 0);

private:

long studentId;

string courses[6];

char coursesGrade[6];

int noOfCourses;

};

Explanation:

Code rewritten

You might be interested in
Please someone helppppppp
Cerrena [4.2K]

Answer : communicate is the answer.

5 0
2 years ago
Read 2 more answers
You have important data on your hard drive that is not backed up and your Windows installation is so corrupted you know that you
love history [14]

Answer:

Make every attempt to recover the data

Explanation:

If your decide to format the drive, use system restore or reinstall the windows OS you may end up loosing all your data so the best option is to try as much as you can attempting to recover the data because the data might or definitely will be lost while using other options you think are available.

8 0
2 years ago
FREE POINT IF YOU ADD ME AS A FRIEND <br> XOXOANAI04
scoray [572]

Answer:

hfufbrdubedyg gxnsbetxyfbrdybeuxuabrbxybsbcyebdydbehdhdhdhcubdenudnejwjw7xtrwhajaobcbdggevejaveyxbwbgzfybaegnesujwbghene8hav ejuzvwbfhuh bsndndbchchychdbruxnejxne7hdrhxhehnxurnxhhbehdndjndhd

8 0
2 years ago
Read 2 more answers
1. Write a program that plays the game of "Guess the Number" as follows: Your program should choose (generate a random number) t
kirill115 [55]

Answer:

The c++ program for the number guessing game is given below.

#include <iostream>

using namespace std;

// method declaration without parameters

void game();

int main() {    

char reply;

// calling the game method

game();  

cout<<"Would you like to play again (y or n)? " <<endl;

cin>>reply;  

if(reply == 'y')

    game();      

if(reply == 'n')

    cout<<"Quitting the game..."<<endl;  

return 0;

}

void game()

{

   int num, guess;

num = (rand() % 10) + 60;  

cout<<endl<<"Welcome to the game of guessing the correct number "<<endl;  

   do

{      

        do

        {

            cout<<"Guess any number between 1 and 1000. "<< endl;

            cin>>guess;

            if(guess<1 || guess>1000)

            {

                cout<<"Invalid number. Guess any number between 1 and 1000. "<<endl;

                cin>>guess;

            }        

             

        }while(guess<1 || guess>1000);    

     

    if(guess < num)

    {

        cout<<"Too Low. Try again."<<endl;            

    }      

    if(guess > num)

    {

        cout<<"Too High. Try again."<<endl;              

    }      

}while(guess != num);  

cout<<"Excellent! You guessed the number!"<<endl;

}

 

OUTPUT

Welcome to the game of guessing the correct number  

Guess any number between 1 and 1000.  

45

Too Low. Try again.

Guess any number between 1 and 1000.  

56

Too Low. Try again.

Guess any number between 1 and 1000.  

63

Too High. Try again.

Guess any number between 1 and 1000.  

61

Too High. Try again.

Guess any number between 1 and 1000.  

57

Too Low. Try again.

Guess any number between 1 and 1000.  

58

Too Low. Try again.

Guess any number between 1 and 1000.  

59

Too Low. Try again.

Guess any number between 1 and 1000.  

60

Excellent! You guessed the number!

Would you like to play again (y or n)?  

n

Quitting the game...  

Explanation:

The expression

(rand() % 10)

generates a random number between 0 and 9. 6 is added to generate a random number between 5 and 15.

The integer variable attempt is initialized to 0.

Next, user is asked to guess the number. If the user enters an invalid input, the do-while loop executes until a valid input is received from the user.

     do

        {

            cout<<"Enter any number between 5 and 15. "<< endl;

            cin>>guess;

            if(guess<5 || guess>15)

            {

                cout<<"Invalid number. Enter any number between 5 and 15. "<<endl;

                cin>>guess;

            }              

            attempt++;              

        }while(guess<5 || guess>15);

User is prompted to input the guess using the same do-while loop as above. Until the user guesses the correct number, the loop continues. Each incorrect guess by the user, increments the variable attempt by 1. This represents the number of attempts done by the user to guess the correct number.

    if(guess < num)

    {

        cout<<"Too Low"<<endl;

    }

    if(guess > num)

    {

        cout<<"Too High"<<endl;  

    }  

The random number generation and the guessing logic is put in a separate method game().

The entry and exit from the game only is put inside the main method.

8 0
3 years ago
In the insert table of figures dialog box which drop down menu do you use to choose what information is displayed in the table
Mashutka [201]

Answer:

caption label

Explanation:

8 0
3 years ago
Other questions:
  • Ive looked everywhere on brainly and we have no answers for computers and technology
    7·1 answer
  • Microsoft's Xbox operating system provides Xbox programmers with a set of common standards to use to access controllers, the Kin
    15·1 answer
  • Name an analog quantity other than temperature and sound
    13·1 answer
  • Write a program that has an array of at least 50 string objects that hold people’s names and phone numbers. The program then rea
    12·1 answer
  • All of the following are helpful tips for protecting your digital privacy, except:
    10·2 answers
  • Pls help me<br> first one to answer correctly gets brainly points
    6·2 answers
  • Find an interesting case on the concept of intellectual property
    14·1 answer
  • Which of the following is an example of two-factor authentication?
    10·2 answers
  • Assignment 1:
    10·1 answer
  • after teaching a group of students about measuring systems and drug calculations, the instructor determines that the teaching wa
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!