Write a C++ program for the instructions below. Please read the instructions carefully and make sure they are followed correctly.
and please put comment with code!
Solution::-
#include <iostream>
using namespace std;
class Brain
{//Define class Brain
public:
Brain()
{//Default constructor of Brain class.
cout <<"\nI think I am smart";
}
};
class Student
{//Define Student class.
private:
//Private member of Student class "name".
string name;
public:
//All public member of Student class define here.
Student()
{
//Default constructor of Student class.
cout<<"\nDefault constructor called";
}
string setName(string name)
{//setName function,Using this operator we have set the name.
this->name = name;
}
string getName(string name)
{//getName function return name.
return name;
}
void printName()
{//printName function print the name.
cout<<"\nMy name is "<< name;
}
};
int main()
{//Define Main function.
string name;
cout<<"Hello C++ I Love CS52";
Student obj; //Creating object of Student class.
name = obj.getName("Angeline Jolie");//Passing name to the getName
function.
obj.setName(name);//calling setName function.
Brain mybrain;//Creating object of Brain class.
obj.printName();//calling printName function.
return 0;
}
Hello C++ I Love CS52 Default constructor called I think I am smart My name is Angeline Jolie |
Write a C++ program for the instructions below. Please read the instructions carefully and make sure they are followed correctly. and please put comment with code! Problem:2 1. Class Student Create...
Write a class called Student. The specification for a Student is: Three Instance fields name - a String of the student's full name totalQuizScore - double numQuizesTaken - int Constructor Default construtor that sets the instance fields to a default value Parameterized constructor that sets the name instance field to a parameter value and set the other instance fields to a default value. Methods setName - sets or changes the student name by taking in a parameter getName - returns...
Write a C++ program for the instructions below. Please read the instructions carefully and make sure they are followed correctly. please put comment with code! and please do not just copy other solutions. Instructions 1. Read instructions carefully! 2. Use C++ syntax only, C syntax will not be accepted. 3. Always use braces to define blocks. 4. Indent all lines within a block. Each block requires one more tab. 5. Organize your code well with proper formatting and a single...
Write a C++ program for the instructions below. Please read the instructions carefully and make sure they are followed correctly. please put comment with code! and please do not just copy other solutions. 1. write the code using function 2. Please try to implement a function after the main function and provide prototype before main function. Total Characters in String Array 10 points Problem 2 Declare a string array of size 5. Prompt the user enter five strings that are...
Java Program (PLEASE PROVIDE SCREENSHOT OF THE CODE) Create a class Person which is a super class. The class includes four private String instance variables: first name, last name, social security number, and state. Write a constructor and get methods for each instance variable. Also, add a toString method to print the details of the person. After that create a class Teacher which extends the class, Person. Add a private instance variable to store number of courses. Write a constructor...
In C++ Write a program that contains a class called VideoGame. The class should contain the member variables: Name price rating Specifications: Dynamically allocate all member variables. Write get/set methods for all member variables. Write a constructor that takes three parameters and initializes the member variables. Write a destructor. Add code to the destructor. In addition to any other code you may put in the destructor you should also add a cout statement that will print the message “Destructor Called”....
Last picture is the tester program! In this Assignment, you will create a Student class and a Faculty class, and assign them as subclasses of the superclass UHPerson. The details of these classes are in the UML diagram below: UHPerson - name : String - id : int + setName(String) : void + getName(): String + setID(int) : void + getID(): int + toString(): String Faculty Student - facultyList : ArrayList<Faculty - rank: String -office Hours : String - studentList...
// Client application class and service class Create a NetBeans project named StudentClient following the instructions provided in the Starting a NetBeans Project instructions in the Programming Exercises/Projects Menu on Blackboard. Add a class named Student to the StudentClient project following the instructions provided in the Starting a NetBeans Project instructions in the Programming Exercises/Projects Menu on Blackboard. After you have created your NetBeans Project your application class StudentC lient should contain the following executable code: package studentclient; public class...
please help Write a simple program with Student class having STL list of Record's structure as a member. 1. Records of the Students are not accessible to the outside world. 2. Student shall output its standing (Freshman, Sophomore etc). 3. A Student can only be created with the name 4. A class can only be added if there is a class name and the passing grade. Driver program creates a Student, adds few classes to the Student's records, then prints...
Please do this in C++. Thank you in advance. Note that you have to carefully create your class using the names and capitalization shown below. Put comments into your program, make sure you indent your program properly, and use good naming conventions. Create a class called entry. It should have two private data members of type std::string. One represents a name and the other represents an email address. Make sure you give them ,meaningful names. Create public getters and setters...
2- Write a program that has a Person class, a Student class, that is derived from Person, and a Faculty class, derived from Person as well, with the following specifications: The Person class has the following members: a. An integer private member variable named SSN. b. Two string protected member variables named firstName and lastName. C. An integer protected member variable named age. d. A constructor that takes SSN, first name, last name, and age as parameters. e. A constructor...