• Please review our updated Terms and Rules here

Help with Applesoft BASIC assignment!!

dude415

New Member
Joined
Nov 19, 2013
Messages
1
Hi all,

New to the forum here! I have a basic programming assignment for a class I'm taking. The assignment is simple: each student will prepare a program in Applesoft BASIC that will generate and print on the screen every four letter word that rhymes with "cat," including nonsense words. I have the code here written in Java, but I don't know how to translate it into Applesoft II.

public class Generate {

public static void main(String[] args) {
Generate one = new Generate();
one.generate();
}

public void generate()
{
char [] alphabet = {'a','b','c','d','e','f','g','h','i','j','k',
'l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'};

for(int i = 0; i < alphabet.length; i++)
{
for(int j = 0; j < alphabet.length; j++)
{
System.out.print(alphabet);
System.out.print(alphabet[j]);
System.out.print("at");
System.out.println();
}
}
}
}

If anyone can write the code for me in BASIC that would be extremely helpful!!! :D
 
Is that CIS 120? I'd be happy to contact the professor and tell him you're having trouble completing the assignment.
 
Honestly, if you can't figure this out on your own with a language reference, I'd change majors.
 
I would be curious what class it is that's teaching some AppleSoft. Pretty cool :) Regardless, find an AppleSoft Basic PDF and it'll list all the commands and how to use them. Shouldn't be too hard if you already have the code in another language to find the correct syntax of those commands again.
 
Writing AppleSoft after having learned Java seems a little weird. Too bad the OP probably will not return to inform us if the class actually used either a real Apple II or an emulator or if it was just submitted on paper. It would be amusing if someone managed to create a legal Basic program that followed a modern language design structure and therefore ran out of stack space when run on an Apple II.
 
I will make 2 simple suggestions here, dude415:

#1: Do your own homework.

Having somebody code for you is NOT the way to go. You'll be more at peace with yourself if you graduate on your own merrits, even with a low GPA.

#2: Go find a simple book on a generic BASIC and read up first.


I bet that your campus library has an old copy of some variant of BASIC (hell, mine had a few on Pascal), and while it won't be the same as Applesoft BASIC more than likely it will be enough to get you started. Read that, and learn from it.
 
The OP sent me a private message with the same request/wording. Seriously!? A total stranger PMs me so I can do his homework? User should be booted from this forum or at least sternly warned.
 

#2: Go find a simple book on a generic BASIC and read up first.

Even better, learn like how most of us did when we had to do the same assignments back in the day: Grab a few other BASIC programs and just look at them. Seriously, the language isn't called BASIC for no reason. Just by looking at a BASIC listing you can glean everything you need to know about writing in the language.
 
If anyone can write the code for me in BASIC that would be extremely helpful!!! :D

Why of course! Here you go:

10 HOME
20 W$="CAT"
30 FOR J=3 TO 1 STEP -1
40 M$=M$+MID$(W$,J,1)
50 NEXT J
60 R$=CHR$(42)
70 H=INT(RND(1)*36)+1
80 V=INT(RND(1)*23)+1
90 HTAB(H):VTAB(V)
100 PRINT M$+R$;
110 GOTO 70

Make sure your instructor shares your grade with the rest of the group here. Only fair! :rolleyes:

-- RP
 
The OP sent me a private message with the same request/wording. Seriously!? A total stranger PMs me so I can do his homework? User should be booted from this forum or at least sternly warned.
I got one as well. Guy really doesn't want to go to the bother of translating a simple algorithm into a simple language, I guess.
 
Back
Top