Qbasicnews.com
February 22, 2020, 08:09:00 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Back to Qbasicnews.com | QB Online Help | FAQ | Chat | All Basic Code | QB Knowledge Base
 
   Home   Help Search Login Register  
Pages: [1] 2
  Print  
Author Topic: Help Me And I Will Become Your Slave  (Read 6953 times)
Janesh
Member
*
Posts: 64


« on: September 06, 2003, 02:59:30 AM »

Ok, call it cheating but i really need help for the project..
first of all heres what i have to do (The month of year thing in the Previous Post was just an Example but it did help):

1: I have to Create a menu driven program to:
    a:Create An Air Ticket
    b:Delete An Air Ticket [Stored in Memory]
    c:Change the Date Of the Ticket
2: Flowchart the whole Program   Sad  Sad  Sad

Worst of all, i have to do all of this over this weekend!!!!!!
Now, if i can have someone SERIOUSLY...and i mean SERIOUSLY help me out...maybe through some IRC Channel or whatever...i would really appreciate it!!!


Trust me, i DESPERATELY NEED TO DO THIS!!!!!]
Logged
whitetiger0990
__/--\__
*****
Posts: 2964



WWW
« Reply #1 on: September 06, 2003, 09:16:13 AM »

prove that you did some of it. nobodie's going to DO YOUR assignment
Logged


[size=10]Back by popular demand!
I will byte and nibble you bit by bit until nothing remains but crumbs.[/size]
Janesh
Member
*
Posts: 64


« Reply #2 on: September 06, 2003, 09:21:17 AM »

Lol..Ok..
[Note: This is only portion of the program]

10 CLS
20 PRINT "1:Book A Ticket"
30 PRINT "2:Cancel A Ticket"
40 PRINT "3:Change Date"
50 PRINT "4:Exit"
60 INPUT "Your Option?"; O
70 IF O = 1 THEN GOSUB 1000
80 IF O = 2 THEN GOSUB 2000
90 IF 0 = 3 THEN GOSUB 3000
100 IF 0 = 4 THEN GOSUB 4000



NOW can i get help ?
Logged
Agamemnus
x/ \z
*****
Posts: 3491



« Reply #3 on: September 06, 2003, 10:26:44 AM »

Question. Are you using QB45.exe or the original BASIC?Huh??
Logged

Peace cannot be obtained without war. Why? If there is already peace, it is unnecessary for war. If there is no peace, there is already war."

Visit www.neobasic.net to see rubbish in all its finest.
Janesh
Member
*
Posts: 64


« Reply #4 on: September 06, 2003, 10:40:09 AM »

QB 1.1
i know lines arent required but i still do it [habit]
Logged
Plasma
Na_th_an
*****
Posts: 1770


WWW
« Reply #5 on: September 06, 2003, 11:02:22 AM »

Post all your code.
Logged
Agamemnus
x/ \z
*****
Posts: 3491



« Reply #6 on: September 06, 2003, 11:36:12 AM »

What data, specifically, does each ticket have?

Also, how do you calculate prices? Is there some list of cities/destinations you're not telling us about??
Logged

Peace cannot be obtained without war. Why? If there is already peace, it is unnecessary for war. If there is no peace, there is already war."

Visit www.neobasic.net to see rubbish in all its finest.
Janesh
Member
*
Posts: 64


« Reply #7 on: September 06, 2003, 11:44:06 AM »

ok..i posted all the details of the assignment in the "Projects" Forum
Please Check that and see if you can help me!
Logged
Agamemnus
x/ \z
*****
Posts: 3491



« Reply #8 on: September 06, 2003, 12:21:20 PM »

That's not enough information to get a price... and what other "details" of people is necessary?
Logged

Peace cannot be obtained without war. Why? If there is already peace, it is unnecessary for war. If there is no peace, there is already war."

Visit www.neobasic.net to see rubbish in all its finest.
Janesh
Member
*
Posts: 64


« Reply #9 on: September 06, 2003, 12:35:49 PM »

ok..im sending the code..
NOTE:
1: This is as far as ive got, theres more to do
2: The cities in the program are from India, as am I, so ignore the names for now

menu:
CLS
PRINT "1:Book a Ticket"
PRINT "2:Cancel a Ticket"
PRINT "3:Change Date Of Departure"
PRINT "4:End"
INPUT "Your Option"; P
ON P GOSUB book, cancel, date, endprog


listofcities:
PRINT "1:Ahmedabad"
PRINT "2:Bangalore"
PRINT "3:Chennai"
PRINT "4:Cochin"
PRINT "5:Coimbatore"
PRINT "6:Delhi"
PRINT "7:Goa"
PRINT "8:Kolkata"
PRINT "9:Mangalore"
PRINT "10:Mumbai"
RETURN

book:
CLS
PRINT "Welcome."
PRINT "To Book Your Ticket, Kindly Fill In The Data"
PRINT "Press A Key To Continue"; R
CLS
from:
GOSUB listofcities
INPUT "Choose The City Your Going From"; F$
IF F$ = 1 THEN LET F$ = AMD
IF F$ = 2 THEN LET F$ = BAN
IF F$ = 3 THEN LET F$ = CHE
IF F$ = 4 THEN LET F$ = COC
IF F$ = 5 THEN LET F$ = COI
IF F$ = 6 THEN LET F$ = DEL
IF F$ = 7 THEN LET F$ = GOA
IF F$ = 8 THEN LET F$ = KOL
IF F$ = 9 THEN LET F$ = MAN
IF F$ = 10 THEN LET F$ = MUM
destination:
GOSUB listofcities
INPUT "Choose Your Destination"; D$
IF D$ = 1 THEN LET D$ = AMD
IF D$ = 2 THEN LET D$ = BAN
IF D$ = 3 THEN LET D$ = CHE
IF D$ = 4 THEN LET D$ = COC
IF D$ = 5 THEN LET D$ = COI
IF D$ = 6 THEN LET D$ = DEL
IF D$ = 7 THEN LET D$ = GOA
IF D$ = 8 THEN LET D$ = KOL
IF D$ = 9 THEN LET D$ = MAN
IF D$ = 10 THEN LET D$ = MUM
same:
IF F$ = D$ THEN GOTO from

class:
CLS
PRINT "Please fill in the following Details in order to make your flight more enjoyable"
INPUT "Please Press A Key To Continue"; U
CLS
PRINT "1:Economy Class"
PRINT "2:Business Class"
INPUT "Please Choose Your Option"; c$
IF c$ = 1 THEN LET c$ = eco
IF c$ = 2 THEN LET c$ = bus

date:
CLS
INPUT "Please select the day of departure [Eg: 06]"; DD
INPUT "Please select the month of departure [Eg: 09"; MM
INPUT "Please select the year of departure [Eg:2003]"; YYYY



==============================================

Ok..Now the first problem is : Will this work ?
Second: I have included 10 cities and with 9 destinations per city,it turns out to be 90 possible combinations [maybe more, my math is bad]...
so now my problem is as follows: HOW DO I PRINT ALL THE VALUES OF ALL THE NINETY COMBOS
I could assign values manually one by one, but it would be a waste of time..THERE HAS GOT TO BE AN EASIER WAY!



Since its already 9 PM out here, im gonna stay awake all night (as it is daytime for ya'll) and write the whole code...but i will need help now and then...will you help??

If yes and, considering you have MSN, add me y0urp0p@hotmail.com..
ill be online most probably...or we can go on like this, but i think MSN would be much faster..
I would really appreciate it if you would help me!
Thanks!
Logged
barok
Na_th_an
*****
Posts: 1727


How about a tasty lead sandwich?


« Reply #10 on: September 06, 2003, 12:46:14 PM »

hmmm... sounds quite a bit like a project i had to do when i did cs20.  i won't help you code-wise, but tell you some other stuff.

1. now, first you should do everything with arrays because it sounds like you are going to book multiple flights.  for example...

dim array(6)

can hold potentially the same amount of information as

array0 = 2
array1 = 23
array2 = 344
array3 = 32
array4 = 56
array5 = 76
array6 = 3

you could do this instead:

array(2) = 344
'code
'code

it will make things easier in one way: you will be working with alot less variables, so you can keep track of your program easier.

2. Subs

Sub is short for subroutine.  to access one, click on edit, then create new sub...  then name it.  a sub contains code that can be executed as many times as you want.  so all of your code for creating a ticket is in this subroutine: "bookticker" for cancelling a ticket: "cancelticket" for changing dates: "changeticket" so if you never used subroutines, your code would look like this:


10 CLS
20 PRINT "1:Book A Ticket"
30 PRINT "2:Cancel A Ticket"
40 PRINT "3:Change Date"
50 PRINT "4:Exit"
60 INPUT "Your Option?"; O
70 IF O = 1 THEN GOSUB 1000
80 IF O = 2 THEN GOSUB 2000
90 IF 0 = 3 THEN GOSUB 3000
100 IF 0 = 4 THEN GOSUB 4000


if you did use subroutines, then you could do this instead:

10 CLS
20 PRINT "1:Book A Ticket"
30 PRINT "2:Cancel A Ticket"
40 PRINT "3:Change Date"
50 PRINT "4:Exit"
60 INPUT "Your Option?"; O
70 IF O = 1 THEN bookticket
80 IF O = 2 THEN cancelticket
90 IF 0 = 3 THEN changeticket
100 IF 0 = 4 THEN end

notice i got rid of "goto 4000" "goto 1000" or whatever?  it's much neater if you use subs. plus, you can use code over and over again.  so suppose you gotta do some math for all the subroutines that calculates everything. instead of writing in the same code over and over again, you can just type in the name of the sub, and it will repeat what code you need!

3. creating a ticket

you'll need several arrays: one that holds the date, one that holds the destination, one holds the area.  several will be used for the math (since you didn't tell us the math, i c an't help you too much there).  you input the data into the variables, then, and calculate the math for the price.  

4. deleting a ticket:

simple.  you simply REDIM the variables.  unless you're using arrays.  then you simply turn all the correct variables into 0.

5. changing a ticket:

easy enough.  just ask the person what date instead to use instead and dump the data into the variable that holds the date.
Logged

Jumping Jahoolipers!
Janesh
Member
*
Posts: 64


« Reply #11 on: September 06, 2003, 01:01:58 PM »

barok..i seriously din understand what u just said..
its like im afraid of arrays, as if arrays were gonna eat me up someday..i just cant get it!!!

no alternatives ?

and uh..please explain the part of all the prices of tickets, i need max help in that!!!!
Logged
barok
Na_th_an
*****
Posts: 1727


How about a tasty lead sandwich?


« Reply #12 on: September 06, 2003, 01:28:08 PM »

we need more info.  and we can only help you so much.
Logged

Jumping Jahoolipers!
Janesh
Member
*
Posts: 64


« Reply #13 on: September 06, 2003, 01:36:29 PM »

what info you want Huh go to my post in "Projects"..i put all the info there by mistake
Logged
Agamemnus
x/ \z
*****
Posts: 3491



« Reply #14 on: September 06, 2003, 03:57:58 PM »

Ok, I see a list of cities now...

Afraid of arrays?  Shocked

Again, you see, there is no information by which one can figure out the cost of a ticket.

No formula.
No relative values for each destination.
etcetcetc....
Logged

Peace cannot be obtained without war. Why? If there is already peace, it is unnecessary for war. If there is no peace, there is already war."

Visit www.neobasic.net to see rubbish in all its finest.
Pages: [1] 2
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!