Sesiones de PyR
Explain it...
0 Votos
2 RespuestasPi calculation on Java
-2 Votos
1 Respuestac++
0 Votos
1 Respuesta"Char" and "Double"
2 Votos
1 Respuestac++ float vs java float
2 Votos
2 RespuestasJava
0 Votos
4 RespuestasWhy Error?
0 Votos
1 RespuestaDistance - c#
0 Votos
3 RespuestasPrime number
2 Votos
3 RespuestasWrite and test a program that solves quadratic equations. A
quadratic equation is an equation of the form ax2+ bx + c =0 ,where a,b and c are given coefficient and x is the unknown The coefficients are real number inputs ,so they should be declared of type float or double Since quadratic equations typically have two solutions ,use x1 and x2 for the solutions to be output These should be declared of type double to avoid inaccuracies from round-off error
-1 Voto
3 Respuestas#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 Voto
5 RespuestasEn tendencia hoy
AI Takeover
2 Votes
Using Python on VScode
1 Votes
Python Developer
0 Votes
Average of Two Numbers
0 Votes
Hearts
0 Votes