Q&A Discussies
#include <iostream>
using namespace std;
class employee
int main()
{
private:
double salary;
public:
void getsalary(double sal)
{
salary=sal;
}
void display()
{
cout<<"the salary:"<<salary;
}
};
void main ()
{
employee programmer;
employee manager;
manager.getsalary (60000.0);
programmer.getsalary(40000.0);
manager.display();
programmer.display();
return 0;
}
1 Stem
5 AntwoordenI wrote a simple basic c++ code in my PC notepad and I saved it with .cpp extension also. But when I run this program in any browser it shows the code as it is... Do c++ code can be written in notepad and can be run? Please answer.
#include <iostream>
using namespace std;
int main()
โด
cout << "hello";
return0;
โต
2 Stemmen
10 Antwoordenpublic class Vehicle {
int maxSpeed;
int wheels;
String color;
double fuelCapacity;
void horn() {
System.out.println("Beep!");
}
}
class MyClass {
public static void main(String[ ] args) {
Vehicle v1 = new Vehicle();
Vehicle v2 = new Vehicle();
v1.color = "red";
v2.horn();
System.out.println(v1);
}
}
Explain its outcome. I am unable to get the last line of outcome.
-1 Stem
2 AntwoordenBeginer Help
2 Stemmen
3 AntwoordenPlease Helpp
1 Stem
1 AntwoordCan you kindly explain this code?
0 Stemmen
1 AntwoordJava
2 Stemmen
3 AntwoordenPopulair vandaag
Coding for Cybersecurity
1 Votes
Need help
1 Votes
Pointers in c#
1 Votes
Decorators in python.
2 Votes
Please click me
0 Votes
Salut tout le monde
1 Votes
How can i isntall modules
1 Votes