This repository was archived by the owner on May 18, 2024. It is now read-only.
forked from its-anaehm/CPP
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathClaseFuncionradical.cpp
More file actions
86 lines (66 loc) · 1.49 KB
/
ClaseFuncionradical.cpp
File metadata and controls
86 lines (66 loc) · 1.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
/*
Desarrolle la clase Funcionradical la cual representa a las funciones radicales y tiene las siguientes
funciones:
. Funcionradical()
. ~Funcionradical()
. Dom(): despliega en pantalla el dominio de la funcion.
. Solucion(): despliega en pantalla la solucion de f(x)=0
Realizado por: HACKZEL NAHUN DELCID FUGON
Asignación: Foro 4C
Fecha: 18/04/2021
*/
#include <iostream>
#include <stdlib.h>
#include <math.h>
using namespace std;
class Funcionradical
{
private:
int a, b, c;
public:
Funcionradical();
setFuncionradical(int, int, int);
void Dom(int, int, int);
void Solucion(int, int, int);
};
Funcionradical::Funcionradical()
{
a=0;
b=0;
c=0;
}
Funcionradical::setFuncionradical(int a, int b, int c)
{
this->a=a;
this->b=b;
this->c=c;
}
void Funcionradical::Dom(int a, int b, int c)
{
float dominio=0;
dominio=-b/a;
cout<<"El dominio es todos los numeros reales positivos mayores que --> "<<dominio<<endl;
}
void Funcionradical::Solucion(int a, int b, int c)
{
float respuesta1=0;
float respuesta2=0;
float respuesta3=0;
respuesta1=pow(-c,2);
respuesta2=respuesta1-b;
respuesta3=sqrt(a*respuesta2+b)-c;
cout<<"La solucion de la funcion radical es --> "<<respuesta3<<endl;
}
int main()
{
int a=0,b=0,c=0;
cout<<"Valores de a, b, c --> "<<endl;
cin>>a;
cin>>b;
cin>>c;
Funcionradical Rad;
Rad.Dom(a,b,c);
Rad.Solucion(a,b,c);
system("pause");
return 0;
}