Computers and Technology

Assign courseStudent's name with Smith, age with 20, and ID with 9999. Use the print member function and a separate cout statement to output courseStudents's data. End with a newline. Sample output from the given program: #include
#include
using namespace std;
class PersonData {
public:
void SetName(string userName) {
lastName = userName;
};
void SetAge(int numYears) {
ageYears = numYears;
};
// Other parts omitted
void PrintAll() {
cout << "Name: " << lastName;
cout << ", Age: " << ageYears;
};
private:
int ageYears;
string lastName;
};
class StudentData: public PersonData {
public:
void SetID(int studentId) {
idNum = studentId;
};
int GetID() {
return idNum;
};
private:
int idNum;
};
int main() {
StudentData courseStudent;
/* Your solution goes here */
return 0;
}

answer
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 03:10, brylove603
Write a program that begins by reading in a series of positive integers on a single line of input and then computes and prints the product of those integers. integers are accepted and multiplied until the user enters an integer less than 1. this final number is not part of the product. then, the program prints the product. if the first entered number is negative or 0, the program must print β€œbad input.” and terminate immediately. next, the program determines and prints the prime factorization of the product, listing the factors in increasing order. if a prime number is not a factor of the product, then it must not appear in the factorization. sample runs are given below. note that if the power of a prime is 1, then that 1 must appear in t
Answers: 3
image
Computers and Technology, 22.06.2019 22:00, noeminm105
Consider the following declarations (1, 2, 3, 5, 7)class bagtype{public: void set(string, double, double, double, double); void print() const; string getstyle() const; double getprice() const; void get(double, double, double, double); bagtype(); bagtype(string, double, double, double, double); private: string style: double l; double w; double h; double price; }; a.) write the definition of the number function set so that private members are set according to the parametersb.) write the definition of the member function print that prints the values of the data membersc.) write the definition of the default constructor of the class bagtype so that the private member variables are initialized to "", 0.0, 0.0, 0.0, 0.0, respectively d.) write a c++ statement that prints the value of the object newbag. e.) write a c++ statement that declares the object tempbag of type bagtype, and initialize the member variables of tempbag to "backpack", 15, 8, 20 and 49.99, respectively
Answers: 3
image
Computers and Technology, 23.06.2019 06:00, tchloe448
What makes myhexadecimalnumber a child of mynumber? which methods does myhexadecimalnumber inherit directly from the mynumber class? what can an instance of the mynumber class do? what can an instance of the myhexadecimalnumber class do? which methods are overridden? why are they overridden? how many examples of overloading are there? why was this done? where is the super keyword used? what is it doing? why isn’t the incoming value set immediately in the second myhexadecimalnumber constructor? how many examples can you find of an inherited method being called?
Answers: 1
image
Computers and Technology, 23.06.2019 13:00, dimondqueen511
Which one of the following voltages should never be measured directly with a vom? a. 1200 v b. 500 v c. 800 v d. 100v
Answers: 2
Do you know the correct answer?
Assign courseStudent's name with Smith, age with 20, and ID with 9999. Use the print member function...

Questions in other subjects:

Konu
Mathematics, 12.12.2021 21:20
Konu
Mathematics, 12.12.2021 21:20
Konu
Business, 12.12.2021 21:20