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
vfiekz [6]
3 years ago
14

Assign courseStudent's name with Smith, age with 20, and ID with 9999. Use the PrintAll member function and a separate cout stat

ement to output courseStudents's data. End with a newline. Sample output from the given program: Name: Smith, Age: 20, ID: 9999
Computers and Technology
2 answers:
agasfer [191]3 years ago
7 0

Answer:

Following are the program in c++

;#include <iostream> // header file

#include <string>

using namespace std;

class student // class

{

   public:

   int ID,age ; // variables

   string courseStudentsname;

   student() // constructor initialize the member

   {

     courseStudentsname="Smith";

     age=20;

     ID=9999;

   }

   void PrintAll() //PrintAll()  function

   {

cout << "Name: " <<courseStudentsname;

cout << ", Age: " << age;

cout << ", ID: " << ID;

}

};

int main() // main function

{

   student e; // create object and call default constructor

   e.PrintAll(); // call the PrintAll() function

   return 0;

}

Explanation:

In the given program we create a three variable inside the class student and declared three variable  ID,age of int type and courseStudentsname of string type after that we create  a constructor and initialize them as value is given in question and finally create a  PrintAll member function which  separate cout statement to output .In the main function create a object class student and call the PrintAll function.

Output:

Name: Smith, Age: 20, ID: 9999

Elodia [21]3 years ago
6 0

Answer:

Following are the program in the C++ Programming Language:

#include <iostream> //header file

using namespace std; //namespace

class Students //define class

{public: //access modifier

 int id,a ; //set variables

 string courseStudentsname; //set variables

 Students() //set constructor

 {

   courseStudentsname="Smith"; //initialize the value

   a=20;  //initialize the value

   id=9999; //initialize the value

   cout<<endl;

 }

 void PrintAll() //define function

 {

   cout << "Name: " <<courseStudentsname<<endl; //print output

   cout << "Age: " << a<<endl; //print output

   cout << "ID: " << id; //print output

 }

};

int main() //define main function

{

 Students obj; //set object and call constructor

 obj.PrintAll(); // call function through object

 return 0;

}

<u></u>

<u>Output</u>:

Name: smith

Age: 20

ID: 9999

Explanation:

Here, we define class "Students" inside it.

  • we define two integer type variable "a" for age of the students and "id" for the id of the students and then we set a string type variable "courseStudentsname" for name of the students.
  • we set the constructor in which we assign the value to the variables.
  • we set the function 'PrintAll()' in which we print all the variables.

Finally, we define the "main()" Function in which we create the object of the class "obj" and call the the "PrintAll()" through the object of the class.

You might be interested in
Unscramble the words <br><br> A: ESUOM RETUPOC <br><br> B: KSID EVIRD
Mrrafil [7]
A. Mouse coputer
B. Disk drive
5 0
4 years ago
Read 2 more answers
Which of the following is a set of short-range wireless technologies used to share information among devices within about two in
8_murik_8 [283]

Answer:

Option (c) NFC

Explanation:

  • The NFC Technology is a Wireless Technology which works in the range of 10 cm or less.
  • NFC stands for Near Field Communications.
  • The name itself indicates that it a communication mode with the near by objects.
  • The NFC technology is used in Access Cards, Payment Cards and Mobile Devices etc.
  • Option (a) IM - Instant Messaging is the instant text messaging technology sends and receives messages over the internet. It is used in Social Media where instant messaging is available. So, option (a) is not correct option.
  • Option (b) text messaging the technology is the technology in which the text messages are sent over the mobile networks ( in case of text messaging in mobile phones ) or over the internet ( emails, blogging etc). So, option (b) is not correct option.
  • Option (d) DES is not a short range wireless technology. So, option (d) is not correct.
  • Option (c) NFC is correct option.
3 0
3 years ago
Who are the best candidates for members of skills USA?
Kryger [21]

Answer:

Is there more to the question? But I have had this question already and the answer is B)

7 0
3 years ago
.Write an if-else statement for the following:
bija089 [108]

Answer:

Solution part of the question:

if(userTickets>5)  //compare the value of userTickets with 5.

       awardPoints = 10; // assign the 10 value to the award point

       else

       awardPoints=userTickets;// assign the userticket value to the awardpoint.

Output:

For the input 4 the output is 4.

For the input 5 the output is 5.

For the input 6 the output is 10.

For the input 7 the output is 10.

Explanation:

All the other part of the program is given on the question so here only if-else statement is given on the answer part. Which is pasted at the place of "/* Your solution goes here */" and the user can get the right answer.

  • In the "if" statement the value of "userTickets" variable is get compared by 5 and if it is greater than 5 than variable "awardpoint" assigns the '10' value.
  • Otherwise, with the help of "else" statement "userticket" variables value (which is the input value for the program) assign to the "awardpoint" variable.
8 0
4 years ago
Read 2 more answers
1. If Earth's plates are constantly moving, why don't we need to update the locations of -
Dmitriy789 [7]

Answer:

Because the tectonic plates are moving so slowly in such small incraments that it would take a while before there was any noticable change.

Explanation:

4 0
3 years ago
Other questions:
  • How to find the biggest files on your computer?
    10·1 answer
  • ____ is a practice where a user in enticed by possible rewards and then asked to provide personal information.
    14·1 answer
  • The Consumer Price Index (CPI) is the tool used to measure inflation. It is calculated through a ____ which asks the amount of m
    7·1 answer
  • Answer the following questions using the five different kinds of parallelism techniques: A - Instruction Level Parallelism B - D
    15·1 answer
  • You want to centrally back up the files users store in the Documents folder in their user profiles, but you don’t want users to
    7·1 answer
  • Edhesive coding practice 3.4​
    12·1 answer
  • Halcyon, an e-publisher, has recently decided to use an information system that administers the way its customers access its onl
    12·1 answer
  • 7 TH GRADE QUESTION...PLS HELP
    12·2 answers
  • Diane changes the size of an image with the format picture pane and keeps the original ratio of height to width of the object. W
    8·1 answer
  • Which of the following best describes a balanced reaction
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!