Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
IMP - Not this old chestnut again
#6
Interesting thing. But IMP is not completely useless.
Example of how logical operators can be used to decide on the creditworthiness of a loan applicant.

Code: (Select All)

'Beispiel fuer logischen Operator IMP; S. 88 - 16. Okt. 2024
'Die Antwort hat keine Auswirkung, nur Kredithoehe zu Monatsverdienst.

'The answer has no effect, only the loan amount is related to monthly income.  A mistake?

Screen _NewImage(800, 400, 32)
Option _Explicit

Dim As Double kreditHoehe, monatsVerdienst
Dim As String antwort

Locate 3, 3
Print "Kreditantrag" 'Loan application
Locate 4, 3
Print "============"

Locate 6, 3
Input "Hoehe des gewuenschten Kredits                  : ", kreditHoehe 'Amount Of desired loan
Locate 7, 3
Input "Arbeitet der Antragsteller in Vollzeit(Ja/Nein)?: ", antwort 'Is the applicant working full-time?
Locate 8, 3
Input "Wie hoch ist der Monatsverdienst?              : ", monatsVerdienst 'Monthly earnings

'Since the applicant is employed full-time, the loan application is approved in the amount of
If kreditHoehe > monatsVerdienst Imp UCase$(antwort) = "Ja" Then
  Locate 10, 3
  Print "Da der Antragsteller einer Vollzeitbeschaeftigung nachgeht,"
  Locate 11, 3
  Print Using "wird der Kreditantrag in Hoehe von ###,###.## Euro genehmigt."; kreditHoehe
  'The applicant does not meet the conditions for a loan of ... The application is denied.
Else
  Beep
  Locate 10, 3
  Print Using "Der Antragsteller erfuellt die Bedingungen fuer einen Kredit in Hoehe von ###,###.## nicht."; kreditHoehe
  Locate 11, 3
  Print "Der Antrag wird abgelehnt."
End If

End

PS: For better understanding

[Image: IMP-Wahrheitstabelle.jpg]
Reply


Messages In This Thread
IMP - Not this old chestnut again - by Dimster - 10-16-2024, 02:57 PM
RE: IMP - Not this old chestnut again - by bplus - 10-16-2024, 04:01 PM
RE: IMP - Not this old chestnut again - by Kernelpanic - 10-16-2024, 06:16 PM
RE: IMP - Not this old chestnut again - by Pete - 10-16-2024, 10:25 PM



Users browsing this thread: 2 Guest(s)