Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

VB_consolenanwendung_schleife?oO

Empfohlene Antworten

Veröffentlicht

moin moin@ all^^

also folgendes,

wir ahben im Unterricht nen prog geschrieben: man gibt nen preis ein un ob man stammkunde is un des prog rechnet denn rabatt aus fals man stammkunde is un der preis über 200€ is.....so un ich dachte mir es wäre doch vllt. sinnvoll wenn man eine "schleife" einbaut falls man sich vertippt hat usw....

jetz ahb i folgendes prob das i net genau wieß wie i des machen soll...un nein der lehrer hilft mir dabei net i soll selba drauf kommen ._.

thx schonma

greetz Chuky

  • Autor

Sub Main()

Dim dblA As Double

Dim strgB As String

Dim dblEndpreis As Double

Dim dblrabatt As Double

Dim strEingaben As String

Console.Write("Guten Tag Lieber Kunde!" & vbNewLine & vbNewLine)

Console.Write("Bitte geben Sie den Preis ein!")

Console.WriteLine()

dblA = Console.ReadLine()

Console.Write("Sind Sie ein Stammkunde? (j/n)")

Console.WriteLine()

strgB = Console.ReadLine()

If dblA >= 200 Then

dblrabatt = dblA / 100 * 5

End If

If strgB = "j" Then

dblrabatt = dblrabatt + (dblA - dblrabatt) * 0.03

End If

dblEndpreis = dblA - dblrabatt

Console.WriteLine("Rabatt: " & Format(dblrabatt, "0.00 Euro"))

Console.WriteLine("Endpreis: " & Format(dblEndpreis, "0.00 Euro"))

Console.WriteLine("Sind Ihre eingaben korrekt? (j/n)" & vbNewLine & vbNewLine)

strEingaben = Console.ReadLine()

If strEingaben = "j" Then

End If

Console.Write("Zum beenden ENTER drücken!")

Console.ReadLine()

End Sub

Ahhh Soviel Textsalat

Code tags bitte benutzen :<

Einfach [ CODE] Code hier reinschreiben [ /CODE] (Die beiden Leerzeichen weglassen.

Ich gehe mal davon aus das wenn ich mich vertippt habe das ich bei der Abfrage ob alle eingaben Korrekt sind "n" eingebe das Programm nochmal neu laufen soll.

Ich würde da eine While Schleife vorschlagen.

Vielleicht kommst du ja selber drauf wie man die da einbaut.

Tip:

Solange

String != j

Wiederhole

Bearbeitet von Skuzzle

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.