import {Cliente} from "./cliente.js";
import {ContaCorrente} from "./cc.js";
const cl1 = new Cliente();
cl1.nome = "Ricardo";
cl1.cpf = 123458697;
const cl2 = new Cliente();
cl2.nome = "Aline";
cl2.cpf = 4189714289;
const cl3 = new Cliente();
cl3.nome = "Felipe";
cl3.cpf = 89731283;
////////////////////////////////
const cc1 = new contaCorrente();
cc1.agencia = 1001;
cc1._saldo = 0;
const cc2 = new contaCorrente();
cc2.agencia = 1001;
cc2._saldo = 0;
const cc3 = new contaCorrente();
cc3.agencia = 1001;
cc3._saldo = 0;
////////////////////////////////
export class Cliente {
nome;
cpf;
}
export class ContaCorrente {
agencia;
_saldo = 0;
sacar(valor){
if(this._saldo >= valor){
this._saldo -= valor;
return valor
}
}
depositar(valor){
if (valor <= 0) return;
this._saldo -= valor;
}
}
PS C:\Users\Newcore\Coding> node .\index.js
node:internal/modules/cjs/loader:930
throw err;
^
Error: Cannot find module 'C:\Users\Newcore\Coding\index.js'
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:927:15)
at Function.Module._load (node:internal/modules/cjs/loader:772:27)
at Function.executeUserEntryPoint
[as runMain] (node:internal/modules/run_main:79:12)
at node:internal/main/run_main_module:17:47 {
code: 'MODULE_NOT_FOUND',
requireStack: []
{
"name": "coding",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC",
"type" : "module";
}
`