140 views2 pages
Verified Note
30 Oct 2018
School
Course
Professor

Document Summary

Some courses at ubc have a single letter after their number, like biol 448g", although most don"t. Suggest two approaches to changing the course data definition to allow this and explain which one you think is better. Approach 1: change the num field so that it is a string rather than an int in the range of 0-699. Then, we could create course numbers that contain both numbers and letters. Approach 2: add a field to the course data type definition for a course number suffix. Its type should be optional so that it could contain a string or none. Approach 3: design a new data type for s string that contains exactly one uppercase letter, perhaps called uppercaseletter, and then add an optional suffix field to course to contain either an uppercasedletter or none. Uppercaseletter = str # contains exactly one uppercase letter. A string that contains exactly one uppercase letter.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents