Liberty Basic

MirKoRn Messages postés 27 Date d'inscription mardi 17 avril 2007 Statut Membre Dernière intervention 18 octobre 2007 - 20 mai 2007 à 22:24
MirKoRn Messages postés 27 Date d'inscription mardi 17 avril 2007 Statut Membre Dernière intervention 18 octobre 2007 - 22 mai 2007 à 17:28
Bonsoir, je dois faire un exercice en Liberty Basic (petit programme gratuis) qui se trouve dans le tutoriel du logiciel mais je ne comprend pas comment faut que je fasse...

je dois faire afficher une liste de 20 noms et de leurs ages en modifiant l'exemple. et voici l'exemple:

'AVERAGE.BAS
  'Accept some numbers from the user, then total and average them
  dim numbers(20)
  print "AVERAGE.BAS"
  print
  'loop up to 20 times, getting numbers
  print "Enter up to 20 non-zero values."
  print "A zero or blank entry ends the series."



[entryLoop]  'loop around until a zero entry or until index = 20
  'get the user's entry
  print "Entry "; index + 1;
  input entry
  if entry = 0 then [endSeries]  'quit if entry is zero or blank
  index = index + 1       'add one to index
  numbers(index) = entry  'set the specified array item to be entry
  total = total + entry   'add entry to the total
  if index = 20 then [endSeries]  'if 20 values were entered, exit loop
  goto [entryLoop]  'go back and get another entry



[endSeries]  'entries are finished
  'Set entryCount to index
  entryCount = index
  if entryCount = 0 then print "No Entries." : goto [quit]
  print "Entries completed."
  print
  print "Here are the "; entryCount; " entries:"
  print "-----------------------------"



  'This loop displays each entered value in turn.
  'Notice that we re-use the index variable.  It
  'can be confusing to use a new variable for each
  'new loop.
  index = 0
[displayLoop]
  index = index + 1
  print "Entry "; index; " is "; numbers(index)
  if index < entryCount then [displayLoop]



  'Now display the total and average value
  print
  print "The total is "; total
  print "The average is "; total / entryCount



[quit]
    end


et voici ma consigne(uniquement en anglais...):

1) Add code to ARRAYS.BAS after [quit] to display all the names entered.



2) There's no reason we can't have more than one array in a BASIC program.  For an example of this, look at the program file for FreeForm.  Altogether, it uses no fewer than 18 arrays.  Some of them are string arrays and some are of the numeric type.  Modify the AVERAGE.BAS program so it asks for a name and age for up to 20 people.  The names should be managed in a string array (remember ARRAYS.BAS?) that you'll add to the program.  When the list of entries is displayed, each name is to be displayed with its age.  Then the total and average age will be displayed after this.  Call the program AGES.BAS.

4 réponses

jmfmarques Messages postés 7666 Date d'inscription samedi 5 novembre 2005 Statut Membre Dernière intervention 22 août 2014 27
21 mai 2007 à 07:46
Bonjour,

Comme tu le dis toi-même, il ne s'agit pas là d'un code écrit en VB mais dans un autre langage apparenté à Basic, dont il faudrait connaître les fondements, la syntaxe, l'IDE et les méthodes pour pouvoir te répondre.
Tout celà devrait se trouver dans l'aide de ton outil, qu'il te faut donc lire avant de développer quoi que ce soit.
0
MirKoRn Messages postés 27 Date d'inscription mardi 17 avril 2007 Statut Membre Dernière intervention 18 octobre 2007
21 mai 2007 à 20:44
je me suis cassé la tête pendant 2h sur l'aide mais je vais y retourner... je pensais que peut-être quelqu'un connaissait se language... mais apparament il faut que je reprenne des cours d'anglais aussi

Enfin bref je vais encore m'amuser un peu!!
0
cs_MPi Messages postés 3877 Date d'inscription mardi 19 mars 2002 Statut Membre Dernière intervention 17 août 2018 23
22 mai 2007 à 00:02
Ne t'en fais pas, 2 heures à fouiller l'aide c'est peu... J'y ai probablement passé 2000 heures... et je continue...

MPi
0
MirKoRn Messages postés 27 Date d'inscription mardi 17 avril 2007 Statut Membre Dernière intervention 18 octobre 2007
22 mai 2007 à 17:28
okay merci!!!

bon je vous avoue que j'ai laissé tombé et je vais faire mon projet en C++!!
c'est un jeu de poker... mais je vais faire sans aucun graphisme, uniquement lié au math!
0
Rejoignez-nous