| 
  • If you are citizen of an European Union member nation, you may not use this service unless you are at least 16 years old.

  • You already know Dokkio is an AI-powered assistant to organize & manage your digital files & messages. Very soon, Dokkio will support Outlook as well as One Drive. Check it out today!

View
 

Exercises - Records

Page history last edited by Steve Sweeney 14 years, 11 months ago
  1. Create a record data structure that will be used to store movie data.  Write a program that will ask the user for information about at least 5 movies.  When input is complete, display the information on the screen.  You might want to see http://www.imdb.com/ for some ideas on the information typically stored for a movie.

    (a) Save the movie information to a file. (Turing Solution)

    (b) Read the movie information from the file. (Turing Solution - Simple Output &  Data File)

    (c) Prompt the user for a "search string" to search for movie names.  Check your movie name fields for a match to the string.  If you find a match, display the information for that movie.  If multiple movies match your criteria, display all of the matches.

     

  2. Write a program that uses the record data structure to read the data from file06.txt.  Print out all entries to the screen in a format similar to the given file.

    (a)  Give the user the option to search for a name.  Display any entires that match from the first name or last name fields.

    (b)  Give the user the option to search for a range of marks (e.g., minimum 75, maximum 100) and display all records that match.

    (c)  When displaying the records, assign each record a number.  Give the user the option to edit one of the records.  Once the user selects a record, you will have to give them the option of editing individual fields within the record.  Think carefully about your interface to perform this task.

     

  3. Create a file with student information for 5-10 students.  For each student, you will need their first name (string), student number (integer), and average (real).

    (a) Read in the file using records.  Output the information using good formatting to display each piece of information in a column.  All data should be nicely aligned with the data above it. (Turing SolutionData File)

    Name                  Student ID                Average

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

    Bob                          123                   75.4

    Doug                         456                   67.8

    (b) Implement a search feature that will let the user search for a name.  If that name is found, display the entire record. (Turing Solution)

    (c) Modify your search feature to let the user search for any *part* of a name (i.e., substrings). (Turing Solution)

    (d) Add searches for student ID and average.  Let the user pick which type of search they want to perform.

    (e) Modify your "average" search to let the user select ranges of grades.  Display all records within the range.

     

     

Comments (0)

You don't have permission to comment on this page.