Beruflich Dokumente
Kultur Dokumente
#include "stdafx.h"
#include "pre1.h"
#include "AccesoDlg.h"
#include "afxdialogex.h"
#include "AccesoDlg.h"
IMPLEMENT_DYNAMIC(CAccesoDlg, CDialogEx)
CAccesoDlg::~CAccesoDlg()
{
}
BEGIN_MESSAGE_MAP(CAccesoDlg, CDialogEx)
ON_BN_CLICKED(IDC_BUTTON1, &CAccesoDlg::OnBnClickedButton1)
ON_BN_CLICKED(IDC_BUTTON2, &CAccesoDlg::OnBnClickedButton2)
END_MESSAGE_MAP()
void CAccesoDlg::OnBnClickedButton1()
{
UpdateData(true);
double nm;
nm=m_pc1;
if(m_pc2<m_pc1)
nm=m_pc2;
if(m_pc3<m_pc2)
nm=m_pc3;
if(m_pc4<m_pc3)
nm=m_pc4;
m_promediopc=(m_pc1+m_pc2+m_pc3+m_pc4-nm)*1.0/3;
UpdateData(false);
// TODO: Agregue aquí su código de controlador de notificación de control
}
void CAccesoDlg::OnBnClickedButton2()
{
UpdateData(true);
m_promediototal=(m_parcial+m_promediopc+2*m_final)*1.0/4;
UpdateData(false);
// TODO: Agregue aquí su código de controlador de notificación de control
}
#include<iostream>
#include<stdlib.h>
#include<time.h>
#include <math.h>
#define pi 2*asin(1.0)
using namespace std;
class Punto{
float A,B,C,D,H;
public:
Punto(float A,float B,float C,float D,float H);
double CA1(float a1);
double CA2(float a2);
double CB1(float b1);
double CB2(float b2);
double HA(float H);
double Di(float a1,float a2,float b1,float b2);
double AR(float D,float H);
double VO(float D,float H);
~Punto(){cout<<"Liberando Memoria ";}
};
void main(){
float x,y,z,w,H,D;
srand((unsigned)time (NULL));
x=rand()%20;
y=rand()%20;
z=rand()%20;
w=rand()%20;
H=rand()%20;
cout<<"x= "<<x<<endl;
cout<<"y= "<<y<<endl;
cout<<"z= "<<z<<endl;
cout<<"w= "<<w<<endl;
cout<<"H= "<<H<<endl;
Punto punto(x,y,z,w,H);
punto.CA1(x);
punto.CA2(y);
punto.CB1(z);
punto.CB2(w);
punto.HA(H);
punto.VO(D,H);
cout<<"\nEl diametro = "<<punto.Di(x,y,z,w)<<endl;
cout<<"\nEl Area del Cilindro = "<<punto.AR(punto.Di(x,y,z,w),H)<<endl;
cout<<"\nEl Volumen del cilindro = "<<punto.VO(punto.Di(x,y,z,w),H)<<endl;
system("pause");
}