Chatbox
Where is the best place we can all link up to have a reunion? A facebook group? Only platform I think we all look at daily hahah but who knows if anyone wants to show their actual face. :P Made one just now -[link]-
2 years ago
Oh I'm so down. I still play zombie escape sometimes on CS:S. Never gets old. So down for Office.
Also 15 years for me. Fuck man we are getting old as shit.
Also, loving Back 4 Blood. Highly recommend to everyone who enjoys coop zombie action. I play on steam. gLiTch handle was retired with FT. You can find me as theRemedy on Steam friends.
Also 15 years for me. Fuck man we are getting old as shit.
Also, loving Back 4 Blood. Highly recommend to everyone who enjoys coop zombie action. I play on steam. gLiTch handle was retired with FT. You can find me as theRemedy on Steam friends.
3 years ago
Super down for a rerun. I think we all have some old connections to plan something ahead of time, on an updated game, or even outdated, for all of us to do an event on. I would look forward to that very much
3 years ago
View all posts (680)
Forums
Fish Tank Clan :: Forums :: General Forums :: Tech Support |
|
« Previous topic | Next topic » |
Qbasic...do you know anything about it. |
Author | Post | ||
creativenate88 |
|
||
![]() ![]() Posts: 263 |
Ok so im in a programming intro class. We are using Qbasic, and our book uses gay pseudo code. I need to know how to use counters. I have looked on my teachers website and googled it. But i cannot find anything of use. If you can help PLEASE do. Nate |
||
Back to top |
|
||
jigg4joe |
|
||
![]() ![]() Posts: 635 |
really no offense here, but if you are having trouble with basic things like loops, you are going to be in for a long class. but, i'm willing to help out so tell me the program you are trying to write or the question you are trying to answer and i will walk you through it. when you say counters, i am assuming you mean some sort of WHILE/FOR loop. here is a very basic loop: FOR counter=startvalue TO limitthe variable 'counter' has an initial value of 'startvalue' and will increment with each pass through the loop until it reaches the value 'limit'. when that happens, the loop terminates and the program continues with the next section of code. that's really all i can tell you with the information provided. if you can be more specific i can help you more. |
||
Back to top |
|
||
creativenate88 |
|
||
![]() ![]() Posts: 263 |
i can write a program using counters i just missread the question, but this program is giving me a fuck load of problems, everything till now has been a breeze..this is the problem.... design an alg that will read through a file and calculate the numbers of married men, single men, married females, and single fem. print these numbers on a student summary report. (txt file named summary) If any single men are over 30 years old print their names and ages on a seperate eligible bachelor file. this input for this file named students appears as follows. Name, Sex, age, availability example: Kathy, F, 31, A or Sam, M, 34, N (N for not available) |
||
Back to top |
|
||
nostie |
|
||
![]() ![]() Posts: 3167 |
i suggest you put in your code and people'll tell you what's wrong with it. it's hard to go off of just that | ||
Back to top |
|
||
jigg4joe |
|
||
![]() ![]() Posts: 635 |
i wish code didn't show up in black, just highlight with your mouse to see it. k, gonna start off with pseudocode. this is the general idea: i_file = OPEN(input_file,r) //open your input file for reading o_file1 = OPEN(output_file,w) //open output file for availability o_file2 = OPEN(output_file2,w) //open output file for over 30 males WHILE line=readline(i_file) //read from file [name,sex,age,availability] = line //start tallying up stats IF sex=male IF availability=A num_A_male++ //# of available males IF age>30 [name,age] -> o_file2 //available males over 30 IF availability=N num_N_male++ //# of unavailable males IF sex=female IF availability=A num_A_female++ //# of available females IF availability=N num_N_female++ //# of unavailable females NEXT //end looping through file //write our values to file [num_A_male,num_N_male,num_A_female,num_N_female] -> o_file1 so that's the general idea. i've never used qBasic, but if you are having trouble i could probably learn it in a few hours. Edited Wed Feb 07 2007, 11:17PM |
||
Back to top |
|
||
jigg4joe |
|
||
![]() ![]() Posts: 635 |
here, try this out for size. i don't have a compiler so i can't tell you if it's buggy or not, but i think it should be a good start! i really wish code didn't show up black!! easiest way to read would probably be to copy and paste to a text file.'FILE VARIABLES '============== DIM i_file$ DIM o_file_summary$ DIM o_file_eligible$ 'INPUT VARIABLES '=============== DIM name$ DIM sex$ DIM age DIM available$ 'OUTPUT VARIABLES '================ DIM num_A_male DIM num_N_male DIM num_A_female DIM num_N_female num_A_male = 0 num_N_male = 0 num_A_female = 0 num_N_female = 0 i_file$ = "readfile.txt" o_file_summary$ = "summary.txt" o_file_eligible$ = "eligible.txt" PRINT "-----------------------" PRINT "| PROGRAM STARTING... |" PRINT "-----------------------" 'open our input file for reading OPEN i_file$ FOR INPUT AS #1 'loop through file until the end DO WHILE NOT EOF(1) 'grab the values from the line INPUT #1,name$,sex$,age,available$ 'if male over 30 and available, write to file IF sex$=="M" AND available=="A" AND age>30 THEN OPEN o_file_eligible$ FOR APPEND AS #2 WRITE #2,name$,age CLOSE #2 END IF 'tally up numbers for males IF sex$=="M" AND available$=="A" THEN num_A_male = num_A_male + 1 END IF IF sex$=="M" AND available$=="N" THEN num_N_male = num_N_male + 1 END IF 'tally up numbers for females IF sex$=="F" AND available$=="A" THEN num_A_female = num_A_female + 1 END IF IF sex$=="F" AND available$=="N" THEN num_N_female = num_N_female + 1 END IF LOOP 'we are done reading from file, close it CLOSE #1 'write our results to the summary file OPEN o_file_summary$ FOR APPEND AS #2 PRINT #2,"SINGLE FEMALES: ",num_A_female PRINT #2,"MARRIED FEMALES: ",num_N_female PRINT #2,"SINGLE MALES: ",num_A_female PRINT #2,"MARRIED MALES: ",num_N_female CLOSE #2 PRINT "---------------------" PRINT "| PROGRAM FINISHED! |" PRINT "---------------------" EDIT: forgot some "END IF"s, but they're in there now Edited Thu Feb 08 2007, 11:27PM |
||
Back to top |
|
||
creativenate88 |
|
||
![]() ![]() Posts: 263 |
Jigg, im gonna steal you from wild and make you mine...i want your babies. Thanks bro that helps alot, it looks alot like my existing code, so i just need to spend more time on it but <3 you buddy thanks alot> NAte | ||
Back to top |
|
||
jigg4joe |
|
||
![]() ![]() Posts: 635 |
np man, i started looking at qbasic and i couldn't stop until the program was finished. wow, i'm a geek.... | ||
Back to top |
|
||
Wildcard23 |
|
||
![]() ![]() Posts: 1067 |
You're the f'in man Jigg!! Holy shit. Took you a couple hours to learn and write a program in a new programming language. LOLs!!!! Dammit. You better stop learning. You aren't allowed to leave our group until we can both leave at the same time. Ha ha haha ah. Nice job on the program Jigg. And no way Nate. Jigg is mine!!!!!!!!!!! | ||
Back to top |
|
||
Powered by e107 Forum System
|
|
Chatbox
Where is the best place we can all link up to have a reunion? A facebook group? Only platform I think we all look at daily hahah but who knows if anyone wants to show their actual face. :P Made one just now -[link]-
2 years ago
Oh I'm so down. I still play zombie escape sometimes on CS:S. Never gets old. So down for Office.
Also 15 years for me. Fuck man we are getting old as shit.
Also, loving Back 4 Blood. Highly recommend to everyone who enjoys coop zombie action. I play on steam. gLiTch handle was retired with FT. You can find me as theRemedy on Steam friends.
Also 15 years for me. Fuck man we are getting old as shit.
Also, loving Back 4 Blood. Highly recommend to everyone who enjoys coop zombie action. I play on steam. gLiTch handle was retired with FT. You can find me as theRemedy on Steam friends.
3 years ago
Super down for a rerun. I think we all have some old connections to plan something ahead of time, on an updated game, or even outdated, for all of us to do an event on. I would look forward to that very much
3 years ago
View all posts (680)
Online
- Guests: 108
- Members: 0
- Newest Member: kremtest
-
Most ever online: 671
Guests: 671, Members: 0 on Sunday 05 January 2025 - 22:03:31