// CliEmprestimo.cpp 
// Definição da classe cEmprestimo
// 11 de Outubro de 2001


#include "emprestimo.h"
#include <iostream.h>

enum { PEDIR_EMPRESTIMO = 1, PAGAR_PRESTACAO , AMORTIZAR , ALTERAR_TAXA_JURO , TERMINAR };

void ClearScreen();
void LerEmprestimo( cEmprestimo *pEmprestimo );
void EscreverEmprestimo( cEmprestimo Emprestimo );


void main()
{  	
  int Opcao;
  bool EmprestimoContraido = false;
  double ValorAmortizacao, NovaTaxaJuro;

  // DECLARAR o OBJECTO Emp da classe cEmprestimo
  

  
  
  do 
  {
	ClearScreen();
	
	if ( EmprestimoContraido )
		EscreverEmprestimo( Emp );
	else
		cout << "Emprestimo nao contraido";
	

	cout << endl << endl ;
	cout << "1. Pedir emprestimo" << endl ;
	cout << "2. Pagar Prestacao" << endl ;
	cout << "3. Amortizar" << endl;
	cout << "4. Alterar a taxa de juro " << endl ;
	cout << "5. Terminar  " << endl;
	cout << endl << endl ;

	cout << "\tEscolha opcao : ";
	cin >> Opcao ;
	cout << endl << endl ;
	
	if ( ( ( Opcao == PAGAR_PRESTACAO ) ||  ( Opcao == AMORTIZAR ) || ( Opcao == ALTERAR_TAXA_JURO ) )
		 && !EmprestimoContraido )  continue;

	switch ( Opcao )
	{		
	 
	 case PEDIR_EMPRESTIMO :
			// COMPLETAR
			

			EmprestimoContraido = true;
			break;
	 case PAGAR_PRESTACAO:
			// COMPLETAR

			break;
	 case AMORTIZAR:
			// COMPLETAR




			break;
	 case ALTERAR_TAXA_JURO:
			// COMPLETAR
			


			break; 
	}
	
	
  } while ( Opcao != TERMINAR );


}

void EscreverEmprestimo( cEmprestimo Emprestimo )
{
  cout << "Dados do emprestimo : " << endl;
  // COMPLETAR	
  



}

void LerEmprestimo( cEmprestimo *pEmprestimo )
{

	double Capital, TaxaJuro;
	int NrAnos;

	cout << "Introduza os dados do emprestimo : " << endl;
	// COMPLETAR




	cout << endl;

	*pEmprestimo = cEmprestimo(TaxaJuro, NrAnos*12, Capital );

}

void ClearScreen()
{
	int i;
	for ( i=0; i<24; i++ ) cout << endl;
}

