Chapter 10 Programming Projects


[Page 549]

  1. The database MICROLAND.MDB is maintained by the Microland Computer Warehouse, a mail-order computer-supply company. Tables 10.5 through 10.7 show parts of three tables in the database. The table Customers identifies each customer by an ID number and gives, in addition to the name and address, the total amount of purchases during the current year prior to today. The table Inventory identifies each product in stock by an ID number and gives, in addition to its description and price (per unit), the quantity in stock at the beginning of the day. The table Orders gives the orders received today. Suppose that it is now the end of the day. Write a program that uses the three tables to do the following:

    1. Display in a list box the items that are out of stock and therefore must be reordered.

    2. Display in a list box bills for all customers who ordered during the day. The bill should indicate if an item is currently out of stock.

    Table 10.5. First three records of the Customers table.

    custID

    name

    street

    city

    amtPurchases

    1

    Michael Smith

    2 Park St.

    Dallas, TX 75201

    234.50

    2

    Brittany Jones

    5 Second Ave

    Tampa, FL 33602

    121.90

    3

    Warren Pease

    7 Maple St.

    Boston, MA 02101

    387.20


    Table 10.6. First three records of the Inventory table.

    itemID

    description

    price

    quantity

    PL208

    Visual Basic

    89.50

    12

    SW109

    MS Office Upgrade

    195.95

    2

    HW913

    Scanner

    49.95

    8


    Table 10.7. First four records of the Orders table.

    custID

    itemID

    quantity

    3

    SW109

    1

    1

    PL208

    3

    1

    HW913

    2

    2

    PL208

    1



  2. [Page 550]
  3. Grade Book. A teacher maintains a database containing two tablesStudents and Grades. The Students table has six fields: socSecNumber, lastName, firstName, streetAddress, cityAndState, and zipCode. The Grades table has four fields: socSecNumber, firstExam, secondExam, and finalExam. At the beginning of the semester, the Students table is filled in completely with a record for each student in a class, and the Grades table has a record for each student that contains only the student's social security number. (Note: The database is contained in the file GRADEBOOK.MDB from the folder Programs\Ch10\MajorDatabases.) Write a program that allows the instructor to record and process the grades for the semester. The program should do the following.

    1. Create a data grid view that can be used to fill in the grades for each student after each exam.

    2. At the end of the semester, display a data grid view showing the name of each student and his or her semester average. The semester average should be calculated as (firstExam + secondExam + 2 * finalExam)/4.

    3. Print a list of semester grades that the instructor can post on his or her office door. The list should contain the last four digits of each student's social security number and the student's semester grade. The semester grade should be determined by the semester average with an A for 90100, a B for 8089, and so on. The list should be ordered by semester average. Note: You can just display the list in a list box instead of actually printing it.

    4. Print a letter for a student (identified by his or her social security number) similar to the one shown below. Note: You can just display the letter in a list box instead of actually printing it.

    George Jackson

    123 Main Street

    Washington, DC 20015

    Dear George,

    Your grades for CMSC 100 are as follows:

    Final Exam: 87

    Semester Grade: B

    Best wishes for a good summer,

    Professor Jones




An Introduction to Programming Using Visual Basic 2005
Introduction to Programming Using Visual Basic 2005, An (6th Edition)
ISBN: 0130306541
EAN: 2147483647
Year: 2006
Pages: 164

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net