Home page

Teacher

On

line

Il sito

Competenze da acquisire

Regole didattiche

Contatore visite
 (dal 18-10-07)
Hit Counter
  Esercitazion PON / TIC Album Fotografico ricreazione_e_video Forum didattico Progetti Alunni Corsi per docenti Download    

IIS: Ragioneria

1°Anno  CAT

2°Anno AFM

3° Anno AFM

3° Anno  SIA

4°Anno AFM

4°Anno SIA

5°Anno SIA


Algoritmi fondamentali


Flow Chart


Codice


Ricordi

Statistiche

Siano forniti in INPUT i seguenti file:

CONTO CORRENTE (ad accesso diretto e relativo), con  SALDO, e NOME CORRENTISTA.

MOVIMENTI (ad accesso sequenziale, con record STRUTTURATI in numero conto, tipo operazione, importo movimentato).

Scrivere un programma che esaudisca le seguenti richieste:

1. Aggiornamento dei saldi nel file CONTO CORRENTE secondo i movimenti effettuati

2. dato in input un numero di conto, stampare su carta tutte le operazioni effettuate su quel conto.

 

'LA SOLUZIONE E' INCOMPLETA: MANCANO LE ISTRUZIONI DI ASSEGNAZIONE,LE CONDIZIONI e GLI INPUT
 

'IL campo NUMERO CONTO non viene memorizzato

Option Explicit
Const numcont = 300
Private Type conticorrenti 'RELATIVO
    saldo As Currency
    nome As String * 30
End Type


Private Type movimenti 'SEQUENZIALE
    numconto As Long
    tipo As String * 20
    importo As Currency 'valore positivo o negativo
End Type
 

Dim conto As conticorrenti
Dim mov As movimenti

Sub AggiornaSaldiEstratticonti()
Dim num_conto As Integer 'numero conto corrente
Dim j As Integer
Dim saldofinale As Currency
Dim mess As String
Dim numrecm As Integer 'numero movimenti totali
Dim risp As String * 1
Open "a:\conto_corrente.dat" For Random As #1 Len = Len(conto)
Open "a:\movimenti.dat" For Random As #2 Len = Len(mov)
Get .............
Do While  .............
    ...........
    Get .............
    ............
    Put ..............
    Get ............
Loop
Close 1
Close 2
End Sub

Sub StampaEstrattoConto()
Dim mess As String, num_conto As Integer
num_conto = InputBox("Dammi il numero di conto corrente!")
Open "a:\conto_corrente.dat" For Random As #1 Len = Len(conto)
Open "a:\movimenti.dat" For Random As #2 Len = Len(mov)
Get ..............
If ........... Then
    mess = .................
    mess = ..................
    Get ...........
    Do While .............
        If ................ Then
            mess = .............
        End If
        Get ...........
    Loop
    MsgBox mess
Else
    MsgBox ("Il conto corrente richiesto non esiste")
End If
Close #1
Close #2
End Sub