19.12.2012 Views

Computer Programming Concepts and Visual Basic David I. Schneider

Computer Programming Concepts and Visual Basic David I. Schneider

Computer Programming Concepts and Visual Basic David I. Schneider

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

13. Additional forms serve as new windows or dialog boxes. They are revealed with<br />

the Show method <strong>and</strong> concealed with the Hide method.<br />

14. Common dialog boxes provide a st<strong>and</strong>ard way of specifying files, colors, <strong>and</strong><br />

fonts, <strong>and</strong> of communicating with the printer.<br />

PROGRAMMING PROJECTS<br />

1. Membership List. Write a menu-driven program to manage a membership list.<br />

(See the following Membership List form.) Assume that the names <strong>and</strong> phone<br />

numbers of all members are stored in the sequential file MEMBERS.TXT. The<br />

names should be read into the list box when the form is loaded <strong>and</strong> the phone<br />

numbers should be read into an array. When a name is highlighted, both the<br />

name <strong>and</strong> phone number of the person should appear in the text boxes at the<br />

bottom of the screen. To delete a person, highlight his or her name <strong>and</strong> click on<br />

the Delete menu item. To change either the phone number or the spelling of the<br />

person’s name, make the corrections in the text boxes <strong>and</strong> click on the menu<br />

item Modify. To add a new member, type his or her name <strong>and</strong> phone number<br />

into the text boxes <strong>and</strong> click on the menu item Add. When Exit is clicked, the<br />

new membership list should be written to a file <strong>and</strong> the program should<br />

terminate.<br />

2. Grade Book. Write a comprehensive program that a professor could use to<br />

record student grades for several classes <strong>and</strong> save the records in sequential files.<br />

(See the preceding Class Grades form.) Each class has three hourly exams <strong>and</strong><br />

a final exam. The file for a single class should consist of the number of students<br />

in the class, call it n, <strong>and</strong> a record of five fields (name, grade1, grade2, grade3,<br />

final) for each student, with the records ordered alphabetically by the student’s<br />

name. (A typical name might appear as “Doe, John”.) Initially, the four grade<br />

fields should contain zeros. The program should contain a top-level menu item,<br />

File, with second-level subitems for Open, Save, Add Student, Remove Student.<br />

When a file is opened (via a file list directory or common dialog box), the data<br />

for the students should be loaded into a grid of n + 1 rows <strong>and</strong> 7 columns. (The<br />

last two columns should remain blank.) The professor should be able to enter<br />

(or alter) exam data by clicking on the cell <strong>and</strong> responding to an input box.<br />

When a student is added, the grid should be enlarged by one row <strong>and</strong> the student<br />

inserted in proper alphabetical position. When a student is deleted, the grid<br />

should be reduced by one row. When the Calculate Semester Grades button is<br />

clicked, the last two columns should be filled in by the program. (Assume that<br />

the final exam counts as two hour exams.) If a grade is changed after the last<br />

<strong>Programming</strong> Projects 317

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!