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.

Pascal

Empfohlene Antworten

Veröffentlicht

Wir haben eine Aufgabe:

"Wahl"

5 Teilnehmer,

Variable Stimmen,

am ende sollen sie sortiert in Prozent angezeigt werden.

Ich habe Problem damit vielleicht kann mir jemanden helfen und erklären.

Ahoi,

muss das in Pascal sein?

Webentwickler

Leider muss das in Free Pascal sein ,das ist unsere Hausaufgabe :-)

Elle

Das könnte vieleicht als kleine Hilfe dienen. Aber Vorsicht!!! Ich habe schon seit einigen Jahren kein Pascak mehr gemacht und einen P-Compiler hab ich auch nicht. Also nur als Denkanstoss gedacht!!!

Mayoh

type

TPerson = record

stimmen : integer;

name : string;

end;

var

Waehler = array[0..4] of TPerson;

Hilfe : integer;

sotiert: boolean;

i : integer;

begin

person[0].name ='Kurt';

person[0].Stimmen = 20;

...

do repeat

sotiert = true;

for i:=0 to 3 do begin

if (person.stimmen > person[i+1].stimmen) then

Begin

Hilfe := person[i+1].stimmen;

person[i+1].stimmen = person.stimmen;

person.stimmen = Hilfe;

sotiert = false;

end;

until (sotiert = true);

end.

<BLOCKQUOTE><font size="1" face="Verdana, Arial, Helvetica">Zitat:</font><HR>Original erstellt von elle:

Leider muss das in Free Pascal sein ,das ist unsere Hausaufgabe :-)

Elle

<BLOCKQUOTE><font size="1" face="Verdana, Arial, Helvetica">Zitat:</font><HR>Original erstellt von mayoh:

Das könnte vieleicht als kleine Hilfe dienen. Aber Vorsicht!!! Ich habe schon seit einigen Jahren kein Pascak mehr gemacht und einen P-Compiler hab ich auch nicht. Also nur als Denkanstoss gedacht!!!

Mayoh

type

TPerson = record

stimmen : integer;

name : string;

end;

var

Waehler = array[0..4] of TPerson;

Hilfe : integer;

sotiert: boolean;

i : integer;

begin

person[0].name ='Kurt';

person[0].Stimmen = 20;

...

do repeat

sotiert = true;

for i:=0 to 3 do begin

if (person.stimmen > person[i+1].stimmen) then

Begin

Hilfe := person[i+1].stimmen;

person[i+1].stimmen = person.stimmen;

person.stimmen = Hilfe;

sotiert = false;

end;

until (sotiert = true);

end.

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.