Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Sales Program.. please help.
#1
Hi! I have a program to write for my gr.11 class.. but I'm having a bit of trouble. Here are the instructions:

You have been hired by the parent council of the school to write a program to record lottery sales in the school. You have decided to write the program in three phases.

Phase One:
a) has a welcome screen
b) reads in the numbers for five sample classes (Homerooms 101, 102..)
c) inputs one day of ticket sales for each of the five sample classrooms
d) calculates the total ticket sales for all five classes in total
e) outputs a summary report with the school name, date, time, sales per class, and total sales

Phase Two:
f) a variable number of classes with classroom numbers input by the user
g) input question which stores the number of students in each homeroom
h) proper exit option
i) summary report including average sales per student per class

Phase Three:
j) input of more than one number per day per class (ex. 101 has 12 sold, then 10 more, etc.)
k) input can be to any homeroom in any order at random
l) summary report must also rank homerooms from most to least sold



** My problem is at c) input one day of ticket sales for each sample class .. I know that I have to write an input statement, but would I put it in a loop to be stored in a DATA statement.. or ?

Any help would be much much much appreciated!

This is what I have so far (other than the welcome screen):

CLS

PRINT "Homerooms in database:"
PRINT

DIM HR(100)
FOR x = 1 TO 5
READ HR(x)
DATA 101,102,103,104,105
NEXT x
FOR x = 1 to 5
PRINT HR(x)
NEXT x


.. Now after here again, I know how to do an input statement for each room, and record it as a separate variable, if that makes sense.. I'm just confused as to how to continue.

Thanks again!
Reply
#2
Okay, so now that problem is solved..

CLS
PRINT "Homerooms in database:"
PRINT

DIM HR(5), Tickets(5)
FOR x = 1 TO 5
READ HR(x)
DATA 101,102,103,104,105
NEXT x
FOR x = 1 TO 5
PRINT HR(x)
NEXT x

REM Input ticket sales per room.
FOR x = 1 TO 5
PRINT " Number of tickets sales room #" + LTRIM$(STR$(HR(x))) + ":";
INPUT Tickets(x)
NEXT x


.. Any ideas as to how I could do either of the following:
f) a variable number of classes with classroom numbers input by the user
g) input question which stores the number of students in each homeroom

?
Reply
#3
Forum policy is no doing homework. :wink: however, somebody said that does not include giving hints... so:

Use arrays.
In the beginning, there is darkness – the emptiness of a matrix waiting for the light. Then a single photon flares into existence. Then another. Soon, thousands more. Optronic pathways connect, subroutines emerge from the chaos, and a holographic consciousness is born." -The Doctor
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)