Create a class called Patient with the following details as variables within it. Name of the Patient (string) Age (int) Gender (char) Disease (string)

 Create a class called Patient with the following details as variables within it. 

  • Name of the Patient (string) 

  • Age (int) 

  • Gender (char) 

  • Disease (string)



Code: 

#include<iostream> 

using namespace std; 

class patient 


public: 

string name; 

int age; 

string gender; 

string disease; 

}; 

int main(){ 

patient p1; 

p1.name = "Rohan "; 

p1.age = 19; 

p1.gender = "Male "; 

p1.disease = "Heart Attack "; 

cout <<"-----Code by Code Champ-----"<< endl; 

cout <<"Name: "<<p1.name << endl <<"Age: "<<p1.age << endl <<"Gender: "<< p1.gender << endl << "Disease: "<< p1.disease << endl;  

 return 0; 

Result/Output:



For more follow on Instagram: Code Champ

Draw Shin Chan using Python Turtle: https://youtu.be/JqS5NJV2chk
Draw Doremon using Turtle in python : https://youtu.be/mfPfSERU2K0
Print name using Python Turtle: https://youtu.be/5XcSBJqQMIc
Indian Flag using Python Turtle: https://youtu.be/XSulTcyWAoE
Amazing Design/ pattern using Python Turtle: https://youtu.be/fIYzTIjJdT4 
Amazing 2Design/ pattern using Python Turtle:  https://youtu.be/5gX09uVdjlo

Difference  between C++ and Java: https://youtu.be/oSLL27bIXKQ

Types of application in java: https://www.instagram.com/p/CUIBrSmv6LM/

No comments:

Powered by Blogger.