Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!doctype html>
- <html>
- <head>
- <meta charset="utf-8">
- <title></title>
- </head>
- <body>
- <script>
- const psatz1 = 0.03
- const psatz2 = 0.06
- const pGrenze = 10000
- var fall, provision, gesamt = 0
- fall = window.prompt('Bitte geben Sie den Wert eines Geschäftfalls ein, für Endausgabe 0 eingeben!')
- while (fall > 0) {
- if (fall < pGrenze) {
- provision = fall * psatz1
- } else {
- provision = fall * psatz2
- }
- document.write('Sie erhalten einen Geschäftsfallprovision von ' + provision + ' €<br>')
- gesamt += provision // gesamt = gesamt + provision
- fall = window.prompt('Bitte geben Sie den Wert eines Geschäftfalls ein, für Endausgabe 0 eingeben!')
- }
- document.write('Sie erhalte insgesamt ' + gesamt + ' € Provision<br>')
- /*
- const psatz1 = 0.03
- const psatz2 = 0.06
- const pGrenze = 10000
- var fall, provision, gesamt = 0
- do {
- fall = window.prompt('Bitte geben Sie den Wert eines Geschäftfalls ein')
- if (fall < pGrenze) {
- provision = fall * psatz1
- } else {
- provision = fall * psatz2
- }
- document.write('Sie erhalten einen Geschäftsfallprovision von ' + provision + ' €<br>')
- gesamt += provision // gesamt = gesamt + provision
- } while (window.confirm("Es wird ein weiterer Geschäftsfall erfasst."))
- document.write('Sie erhalte insgesamt ' + gesamt + ' € Provision<br>')
- */
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement