COMP 220 iLab 7 of 7

comp 220 COMP/220 iLab 7 of 7 – C++ Course


iLab 7 of 7: Polymorphism

i L A B  O V E R V I E W          

Scenario and Summary   

This lab introduces students to the concepts of polymorphism, early binding, late binding, abstract classes, and virtual class functions. This will be done in the context of performing calculations on basic geometrical shapes. Polymorphism is a very powerful extension of inheritance, and by using pointers to the base class, it allows access to derived class objects and their functions based on the context that they are called in.

The lab will require the creation of a base geometric class, called Shape, and two sub classes, Circle and Rectangle, that are derived public from the class Shape. From there, objects of both the Circle and the Rectangle classes will be created, as will an array of pointers to the base class Shape. By using the instantiated objects and the object pointers, both static and dynamic binding will be demonstrated.

Deliverables

1.       Submit a single NotePad file containing the source code for all the lab files to the Week 7 Dropbox. Your source code should use proper indentation and be error free. Be sure that your last name and the lab number are part of the file name: for example, YourLastName_Lab5.txt.

Each program should include a comment section that includes, at a minimum, your name, the lab and exercise number, and a description of what the program accomplishes.

2.       Submit a lab report (a Word document) containing the following information to the Week 7 Dropbox.

o        Include your name and the lab or lab exercise number.

o        Specification: Include a brief description of what the program accomplishes, including its input, key processes, and output.

o        Test Plan: Include a brief description of the method you used to confirm that your program worked properly. If necessary, include a clearly labeled table with test cases, predicted results, and actual results.

o        Summary and Conclusions: Write a statement summarizing your predicted and actual output, and identify and explain any differences. For conclusions, write at least one nontrivial paragraph that explains, in detail, either a significant problem you had and how you solved it or, if you had no significant problems, something you learned by doing the exercise.

o        A UML Diagram: This should show all the classes, class members, access specifiers, data types, and function arguments, along with all of the class-to-class relationships.

o        Answers to Lab Questions: Include the answers to all the lab questions that are asked in the lab steps.

Each lab exercise should have a separate section in the lab-report document.

Your lab grade is based upon

1.       the formatting of your source code;

2.       the use of meaningful identifiers;

3.       the extent of the internal documentation;

4.       the degree to which an exercises’ specifications are met; and

5.       the completeness of your lab report.

i L A B  S T E P S       

STEP 1: Create a New Multifile Project       

Create a new multifile project with three classes: the base class Shape, the class Circle (derived public from Shape), and the class Rectangle (derived public from Shape). The classes will have the following requirements.

1.       The class Shape should be an abstract class with the following pure virtual functions.

a.       area()

b.       perimeter()

2.       The class Circle should be derived public from the class Shape and override both the area() and the perimeter() functions.

a.       The perimeter() function should correctly calculate the circumference of a circle, given a radius.

b.       The area() function should correctly calculate the area of a circle, given a radius

c.       Include all the necessary accessor and mutator functions to accomplish the requirements of the class.

3.       The class Rectangle should be derived public from the class Shape and override both the area() and the perimeter() functions.

a.       The perimeter() function should correctly calculate the circumference of a rectangle, given its dimensions.

b.       The area() function should correctly calculate the area of a rectangle, given its dimensions.

c.       Include all the necessary accessor and mutator functions to accomplish the requirements of the class.

STEP 2: Create the Test Function      

Instantiate at least one object of each of the Circle and the Rectangle classes. Provide appropriate constructors for both that will accept the necessary initialization arguments to provide the information required for all the class member functions. Exercise and test each member function of both classes for correct calculations and output.

STEP 3: Add a Base Class Pointer Array and an Additional Function  

Add to the test function a base class array of pointers of the same dimension as the total number of Circle and Rectangle objects that were created in the previous step. Use this pointer array to access the Circle and the Rectangle objects to call a new, nonclass member function that will display all the information about each object.

1.       Circle objects should display radius, circumference, and area.

2.       Rectangle objects should display dimensions, perimeter. and area.

The information-display function should accept as its calling parameter a pointer of the class Shape.

Run the test function to demonstrate static (early) binding using the derived class objects calling their member functions, and run the test function to demonstrate dynamic (late) binding using the assigned Shape class pointers to call the nonclass, member-display-information function.

 

 

 PRICE $ 19.99

           

COMP 220 iLab 6 of 7

comp 220 COMP/220 iLab 6 of 7 – C++ Course


iLab 6 of 7: Overloaded Operators

i L A B  O V E R V I E W      

Scenario and Summary 

This lab is to introduce students to the concept of operator overloading as member functions of a class. This will be done in the context of creating a class that will perform four basic mathematical operations on complex numbers.

The C++ compiler has defined operators for all the arithmetic and assignment operations for its native data types, such as integer, float, double, and so forth. However, for user-defined data types, such as classes and structures, these operations are undefined.

C++ allows the programmer to create new definitions for these operators so that they can operate specifically on these user-defined data types. Which set of operators is actually called and implemented is decided during the compilation, and it is based on the data types of the operands involved in the operation.

The ability to define a new set of data-type, dependent operations on existing operators, or functions, is called operator overloading.

Deliverables

1.            Submit a single Notepad file containing the source code for all files of the lab to the Week 5 Dropbox. Your source code should use proper indentation and be error free. Be sure that your last name and the lab number are part of the file name: for example, YourLastName_Lab5.txt.

Each program should include a comment section that includes, at a minimum, your name, the lab and exercise number, and a description of what the program accomplishes.

2.            Submit a lab report (a Word document) containing the following information to the Week 6 Dropbox.

o             Include your name and the lab or lab exercise number.

o             Specification: Include a brief description of what the program accomplishes, including its input, key processes, and output.

o             Test Plan: Include a brief description of the method you used to confirm that your program worked properly. If necessary, include a clearly labeled table with test cases, predicted results, and actual results.

o             Summary and Conclusions: Write a statement summarizing your predicted and actual output, and identify and explain any differences. For conclusions, write at least one nontrivial paragraph that explains, in detail, either a significant problem you had and how you solved it or, if you had no significant problems, something you learned by doing the exercise.

o             A UML diagram: This should show all the classes, class members, access specifiers, data types, and function arguments, along with any and all class-to-class relationships.

o             Answers to Lab Questions: Include the answers to any and all lab questions asked in the lab steps.

Each lab exercise should have a separate section in the lab-report document.

Your lab grade is based upon

1.            the formatting of your source code;

2.            the use of meaningful identifiers;

3.            the extent of internal documentation;

4.            the degree to which an exercises’ specifications are met; and

5.            the completeness of your lab report.

i L A B  S T E P S  

STEP 1: Create a New Multifile Project  

Create a new multifile project, and create a class to model complex-number, mathematical operations using overloaded operators and add main() test functions to test the operations.

1.            Create a class for complex numbers that will provide the means to store both the real and the imaginary values of a complex number.

2.            Design and add overloaded operators to perform correct and complex mathematical operations on objects of the complex-number class.

STEP 2: Create and Add the Overloaded Operators         

1.            Overload the addition operator (+) to perform complex mathmatical addition on two objects of the complex-number class.

2.            Overload the subtraction operator (-) to perform complex mathmatical subtraction on two objects of the complex-number class.

3.            Overload the multiplication operator (*) to perform complex mathmatical multiplication on two objects of the complex-number class.

4.            Overload the division operator (/) to perform complex mathmatical division on two objects of the complex-number class.

5.            Overload the assignment operator (=) to assign all the data values of an object in the complex-number class to another object in the complex-number class.

STEP 3: Test the Overloaded Operators

Create at least three objects of the complex-number class in function main() and use them to perform the following operation tests.

1.            Demonstrate the correct operation of the complex addition overloaded operator.

2.            Demonstrate the correct operation of the complex subtraction overloaded operator.

3.            Demonstrate the correct operation of the complex division overloaded operator.

4.            Demonstrate the correct operation of the complex multiplication overloaded operator.

 

 PRICE $ 19.99

           

COMP 220 iLab 5 of 7

comp 220 COMP/220 iLab 5 of 7 – C++ Course


iLab 5 of 7: Pointers and Pointer Operations

i L A B  O V E R V I E W      

Scenario and Summary 

This lab will explore the use of pointers in several ways. Pointers will be used to dynamically allocate memory for new class objects on demand from the user, and they will be used to access class-member functions. Pointer arithmetic will be used to access and sort class objects according to criteria explained in the lab.

Pointers are, essentially, address variables, or variables that hold as their value the address of other variables. In terms of memory management, they are very powerful devices, and they more closely and efficiently use the actual internal hardware registers of the microprocessor that the program operates on.

Pointers also have the requirement that the pointer type must be of the same data type as the variable, or the data that it points to or holds the address of. The power of pointers also hints at the potential complexity of their use, which is why this lab is focused almost entirely on several different aspects and uses of pointers. The lab also introduces pointer arrays and pointers to pointers.

The Resistor class created in the Week 2 lab will be used as the class that the pointer operations will be used upon. The lab also requires the use of accessor functions and static data members, which may need to be added to the Resistor class definition and implementation.

Deliverables

1.            Submit a single Notepad file containing the source code for all the files of the lab to the Dropbox for Week 5. Your source code should use proper indentation and be error free. Be sure that your last name and the lab number are part of the file name: for example, YourLastName_Lab5.txt.

Each program should include a comment section that includes, at a minimum, your name, the lab and exercise number, and a description of what the program accomplishes.

2.            Submit a lab report (a Word document) containing the following information to the Dropbox for Week 5.

o             Include your name and the lab or lab-exercise number.

o             Specification: Include a brief description of what the program accomplishes, including its input, key processes, and output.

o             Test Plan: Include a brief description of the method you used to confirm that your program worked properly. If necessary, include a clearly labeled table with test cases, predicted results, and actual results.

o             Summary and Conclusions: Write a statement summarizing your predicted and actual output, and identify and explain any differences. For conclusions, write at least one nontrivial paragraph that explains, in detail, either a significant problem you had and how you solved it or, if you had no significant problems, something you learned by doing the exercise.

o             A UML diagram: This should show all classes, class members, access specifiers, data types, and function arguments, along with any and all class-to-class relationships.

o             Answers to Lab Questions: Answer any and all lab questions included in the lab steps.

Each lab exercise should have a separate section in the lab-report document.

Your lab grade will be based upon

1.            the formatting of your source code;

2.            the use of meaningful identifiers;

3.            the extent of internal documentation;

4.            the degree to which an exercises’ specifications are met; and

5.            the completeness of your lab report.

i L A B  S T E P S  

STEP 1: Create a Multifile Project             

Create a new multifile project using the Resistor class developed in Week 1, and include a new main() test function.

STEP 2: Modify the Resistor-Class Definition       

1.            Add a static data member of the class Resistor to keep track of the number of Resistor objects that are dynamically created. This will also be used to limit the number of objects that are dynamically created to the maximum array size of the pointer array in the test function main().

2.            In the Resistor constructor, use a random-number generator to randomly assign a nominal resistance value to the object between 1,000 and 10,000 ohms. The resistance values are not required to be standard resistance values.

STEP 3: Create the Test Function Main() and the Support Function          

1.            Create an array of pointers of type Resistor.

2.            Use elements of the pointer array to allow the user to dynamically allocate memory and to instantiate objects of the Resistor class.

3.            Use the indirect member-selection operator (pointer) in the test routine to access function members of the Resistor class.

4.            Write a new, nonclass function called in function main() to sort the pointers to the Resistor objects in order from lowest nominal resistance value to highest, passing a pointer to the Resistor-object pointer as the only passed data argument.

5.            Display the sorted Resistor objects according to the nominal resistance value, from lowest to highest.

6.            Within the sorting function, use pointer arithmetic to access the individual Resistor objects.

7.            Function main() should also ensure that there are no memory leaks when the program ends.

 PRICE $ 19.99

           

COMP 220 iLab 4 of 7

comp 220 COMP/220 iLab 4 of 7 – C++ Course


i L A B  O V E R V I E W      

Scenario and Summary 

This lab requires you to use C++ class composition to implement a single pole-filter design program. The program will allow the user to specify resistor and capacitor values and filter type. Once all the user parameters are specified, the program will return the cutoff frequency values for the filter.

Composition may be thought of as a has-a relationship for objects, as compared to inheritance, which may be described as an is-a relationship for objects.

You are required to use two component classes: one for a resistor object and one for a capacitor object. You are then to define and implement a filter class that will contain one object of each the resistor and the capacitor classes in order to create the filter and its characteristics.

The Resistor class created in the Week 2 iLab may be used both as the class definition for the resistor object and as a template or a guide for the capacitor-class definition.

The lab also requires you to implement your program in a multiple-file project and create both cpp and h files for each class defined. In addition, the program will have the capacity to save all filter parameters to a text file and read previously designed filter parameters from a text file.

Deliverables

1.            Submit a single Notepad file containing the source code for all the files of the lab to the Dropbox for Week 4. Your source code should use proper indentation and be error free. Be sure that your last name and the lab number are part of the file name: for example, YourLastName_Lab4.txt.

Each program should include a comment section that includes, at a minimum, your name, the lab and exercise number, and a description of what the program accomplishes.

2.            Submit a lab report (a Word document) containing the following information to the Dropbox for Week 4.

o             Include your name and the lab or lab-exercise number.

o             Specification: Include a brief description of what the program accomplishes, including its input, key processes, and output.

o             Test Plan: Include a brief description of the method you used to confirm that your program worked properly. If necessary, include a clearly labeled table with test cases, predicted results, and actual results.

o             Summary and Conclusions: Write a statement summarizing your predicted and actual output, and identify and explain any differences. For conclusions, write at least one nontrivial paragraph that explains, in detail, either a significant problem you had and how you solved it or, if you had no significant problems, something you learned by doing the exercise.

o             A UML diagram: This should show all classes, class members, access specifiers, data types, and function arguments, along with the composition relationship of the classes.

o             Answers to Lab Questions: The answers to any and all lab questions are included in the lab steps.

Each lab exercise should have a separate section in the lab-report document.

Your lab grade will be based upon

1.            the formatting of your source code;

2.            the use of meaningful identifiers;

3.            the extent of internal documentation;

4.            the degree to which an exercises’ specifications are met; and

5.            the completeness of your lab report.

i L A B  S T E P S  

STEP 1: Create a Multifile Project for the Composition Lab           

1. Add three classes to the project: a Filter class, a Capacitor class, and a Resistor class.

2. You may use the Resistor class files from the Week 2 lab for this lab.

3. The Capacitor class should be modeled after the Resistor class for class members and operation.

STEP 2: Filter-Class Definition     

The Filter class should have, at a minimum, the following capabilities.

1.            a resistor-object data member

2.            a capacitor-object data member

3.            a cutoff frequency (in Hertz) of the RC filter

4.            maximum and minimum cutoff frequencies, based on the maximum and minimum in-tolerance values of the capacitor and the resistor object

5.            a filter type, either low pass or high pass

6.            allow the user to enter new values for the filter, including

6.1. resistor tolerance and nominal resistance;

6.2. capacitor tolerance and nominal capacitance; and

6.3. filter type

7.            provides the ability to write all capacitor, resistor, and filter data members to a formatted text file and allows the user to name the file

8.            provides the ability to read all capacitor, resistor, and filter data members from a formatted text file and allows the user to enter the file name and correctly handles a file-not-found error

STEP 3: Test-Program Operation              

1.            All data-input and data-display operations (cin and cout) should be done in the function main() test program.

2.            The test program should instantiate at least one object of the class Filter.

a.            The user should enter values for all the data members of the Filter, Resistor, and Capacitor classes.

b.            The Filter class should then calculate and display the correct maximum and minimum cutoff frequencies.

3.            The test program should then display all Filter, Resistor, and Capacitor data members.

 PRICE $ 19.99

           

COMP 220 iLab 3 of 7

comp 220 COMP/220 iLab 3 of 7 – C++ Course


i L A B O V E R V I E W       

Scenario and Summary 

This lab introduces you to writing a C++ program to implement the concept of class inheritance using different types of bank accounts as a model. In this lab, you will create a base class, called CBankAccount, and two additional classes (each derived from CBankAccount), called CSavingsAccount and CCheckingAccount. You will then test the operations of each class in function main() to simulate the transactions of both a checking account and a savings account.

Deliverables

1.            Submit a single Notepad file containing the source code for all the files of the lab to the Dropbox for Week 3. Your source code should use proper indentation and be error free. Be sure that your last name and the lab number are part of the file name: for example, YourLastName_Lab3.txt.

Each program should include a comment section that includes (minimally) your name, the lab and exercise number, and a description of what the program accomplishes.

2.            Submit a lab report (a Word document) containing the following information to the Dropbox for Week 3.

o             Include your name and the lab or lab-exercise number.

o             Specification: Include a brief description of what the program accomplishes, including its input, key processes, and output.

o             Test Plan: Include a brief description of the method you used to confirm that your program worked properly. If necessary, include a clearly labeled table with test cases, predicted results, and actual results.

o             Summary and Conclusions: Includea summary of what the lab demonstrated and any conclusions drawn from the testing of the lab program.

o             Provide a UML diagram showing the base and the derived class relationships, access specifiers, data types, and function arguments.

o             Answers to Lab Questions: Answer any and all of the lab questions included in the lab steps.

Summary: Write a statement summarizing your predicted and actual output. Identify and explain any differences.

Conclusions: Write at least one nontrivial paragraph that explains, in detail, either a significant problem you had and how you solved it or, if you had no significant problems, something you learned by doing the exercise.

Each lab exercise should have a separate section in the lab-report document.

Your lab grade is based upon

1.            the formatting of your source code;

2.            the use of meaningful identifiers;

3.            the extent of internal documentation;

4.            the degree to which an exercises’ specifications are met; and

5.            the completeness of your lab report.

i L A B S T E P S    

STEP 1: Create the Multifile Project and the Main (Base) Class   

Create a new project that consists of the base class BankAccount.

The BankAccount class should contain, at minimum, the following members.

1.            It should contain data members to store a bank customer’s balance and account number. These should be of different and appropriate data types.

2.            It should have function members that do the following:

a.            set the account number;

b.            return the account number;

c.             return the account balance;

d.            deposit money into the account; and

e.            withdraw money from the account.

STEP 2: Create the CheckingAccount Class Derived From the BankAccount Class

The class CheckingAccount should contain, at a minimum, the following members.

1.            It should contain a data member to keep track of the number of withdrawal transactions made on the account. Whenever a withdrawal is made, this number should be incremented.

2.            Override the base class, withdraw-money function, and add the capability to deduct transaction fees from an account using the following guidelines.

a.            The checking account is allowed three free transactions. For each successful withdrawal transaction past the three free transactions, there will be a service fee of 50 cents per transaction. The service fee should be deducted from the account balance at the time the transaction is made.

b.            If there are insufficient funds in the account balance to cover the withdrawal plus the service fee, the withdrawal should be denied.

c.             The function should return a value to indicate whether the transaction succeeded or failed. Transaction fees should be deducted only from successful transactions, but the transaction count should be incremented in either case.

STEP 3: Create the SavingsingAccount Class Derived From the BankAccount Class             

The class CheckingAccount should contain, at a minimum, the following members.

1.            It should contain a data member to hold the daily interest rate. The daily interest rate can be calculated from a yearly interest rate by dividing the annual rate by 365.

2.            It should contain a data member to keep track of the number of days since the last transaction or balance inquiry. This should be updated using a random-number generator (reference Lab 1) that will return a value representing the number of days between 0 and 7, inclusive. We will assume that this bank is open every day of the year.

3.            It should contain a data member to hold the interest earned since the last transaction or balance inquiry.

4.            It should contain a function member to set the annual interest rate.

5.            Utilize the base-class functions for both withdrawal and deposit operations for the savings account.

6.            Override the base-class-balance inquiry function to add calculating and adding interest to the account based on the daily interest rate, the current balance of the account, and the number of days since the last balance inquiry. This should be called only when a balance inquiry is made, not when a deposit or withdrawal transaction or an account number inquiry is made.

7.            If there are insufficient funds in the account balance to cover a withdrawal, the withdrawal should be denied. The number of days since the last transaction or balance inquiry and the interest calculations should still be made.

8.            A value should be returned to indicate whether a withdrawal transaction succeeded or failed.

9.            It should contain a function member to return the interest earned since the last transaction or balance inquiry.

10.          It should contain a function member to return the number of days since the last transaction or balance inquiry.

STEP 4: Test Program Operation               

1.            All data-input and data-display operations (cin and cout) should be done in the function main() test program.

2.            The test program should create one checking account and one savings account with initial balances of $100 each using the functions defined in the class definitions. The test program should also assign a unique, five-digit account number to each account and assign an annual interest rate of 3% for the savings account.

3.            The test program should then display a menu that allows the user to select which option is to be performed on which account, including the following.

a.            Make a deposit and specify the amount to a selected or an entered account.

b.            Make a withdrawal and specify the amount to a selected or an entered account.

c.             Return the balance of a selected or an entered account.

i.              For deposit transactions, withdrawal transactions, and balance inquiries, the updated balance and any fees charged or interest earned should also be displayed.

ii.             For the savings account, the number of days since last transaction should be displayed.

d.            Exit the program.

4.            Each account operation should display the account number and the account type.

Lab Questions  

Please answer all the lab questions in the text file that is to be turned into the Dropbox. You are not required to copy the question text into your document, but all answers should be listed with the question number they answer.

1.            Were any base-class functions called or overloaded in either of the derived classes? If so, list which class and which function, and explain why they were either called or overloaded.

2.            Were any derived-class functions not explicitly called by the test program? If so, list which class and function, and explain why this was done.

3.            Which access attribute was used for each of the classes derived from the base class? Why was this access attribute chosen?

 PRICE $ 19.99

           

COMP 220 iLab 2 of 7

comp 220 COMP/220 iLab 2 of 7 – C++ Course


i L A B  O V E R V I E W      

Scenario and Summary 

This lab requires you to create a multifile C++ project in order to design and implement an object-oriented program using a class to model the characteristics and function of a resistor.

Deliverables

1.            Submit a single Notepad file containing the source code for Exercise 1 to the Dropbox for Week 2. Your source code should use proper indentation and be error free. Be sure that your last name and the lab number are part of the file name; see the following example: YourLastName_Lab1.txt.

Each program should include a comment section that includes (at a minimum) your name, the lab and exercise number, and a description of what the program accomplishes.

2.            Submit a lab report (a Word document) containing the following information to the Dropbox for Week 2.

o             Include your name and the exercise number.

o             Specification: Include a brief description of what the program accomplishes, including its input, key processes, and output.

o             Test Plan: Include a brief description of the method you used to confirm that your program worked properly. If necessary, include a clearly labeled table with test cases, predicted results, and actual results.

o             Summary and Conclusions: Include a summary of what the lab demonstrated and any conclusions drawn from the testing of the lab program.

o             Answers to Lab Questions: Answer any and all lab questions included in the lab steps.

Summary: Write a statement summarizing your predicted and actual output. Identify and explain any differences.

Conclusions: Write at least one nontrivial paragraph that explains, in detail, either a significant problem you had and how you solved it or, if you had no significant problems, something you learned by doing the exercise.

Each lab exercise should have a separate section in the lab-report document.

Your lab grade will be based upon

1.            the formatting of your source code;

2.            the use of meaningful identifiers;

3.            the extent of internal documentation;

4.            the degree to which an exercises’ specifications are met; and

5.            the completeness of your lab report.

i L A B  S T E P S  

STEP 1: Create a Multifile Project             

Objective: Create a C++ console application that will model the characteristics of a resistor.

1.            Create a multifile project. Create and add to the project an h file containing the resistor-class definition.

2.            Create and add to the project a cpp file containing the implementation of the class-member functions.

3.            Create and add to the project a ccp file containing the main() function, which will instantiate a resistor object and test its member functions.

STEP 2: Required Class Members             

The resistor class will, at minimum, have members that do the following.

1.            store the nominal resistance value of a resistor

2.            store the tolerance of a resistor

3.            initialize any and all nominal-resistance values to correct, EIA, nonzero values that are greater than 0 and less than 1,000,000 ohms

4.            initialize any and all resistance-tolerance values to correct, E12, E24, E48, or E96 resistance-tolerance values

5.            allow the nominal-resistance and tolerance values of a resistor object to be changed by the user

6.            All member functions should have a test message stating the name of the function. All the test messages should be displayed or not displayed, depending on the value of a Boolean variable declared in main().

a.            If the Boolean value = true, display the message.

b.            If the Boolean value = false, do not display the message.

STEP 3: Program Operations       

1.            Function main() should instatiate two objects of class resistor.

2.            Function main() should display the current values of all resistor objects.

a.            Function main() should also calculate and display the minimum and maximum in-tolerance resistance values of each resistor object from the resistor data members.

3.            Function main() should allow the user to change the values of the nominal resistance and the resistor tolerance of both resistor objects, and it should also correctly handle out of numeric-range input. Main() is also responsible for making sure that the user can successfully enter only correct, EIA resistance and tolerance values.

a.            The user should be given the following data-entry choices:

1.            accept current EIA values for resistance and tolerance;

4.            The function main() should display the new, modified values of the resistor object, including the new min and max in-tolerance resistance values.

5.            The function main() should be executed twice: once with the test messages displayed and once without.

STEP 4: Lab Questions   

You are not required to copy the question text into your document, but all answers should be listed with the question number they answer.

1.            List the complete reference-source information for where you found the EIA standard resistor value and tolerance information.

2.            How was this reference discovered and where?

3.            The constructor requires the initialization values for the nominal resistance and the tolerance when an object is instantiated to be a correct E-series resistance and tolerance combination. Describe how this was accomplished in your program design and implementation.

4.            In the lab, you were required to provide mutator functions to change the nominal-resistance and tolerance values of a resistor object.

a.            Describe how this was accomplished so that the user could not enter an invalid nominal-resistance and E-series tolerance combination.

5.            Describe how this process was different and/or similar to how you implemented this validation in the class constructor.

 

 PRICE $ 19.99

           

CIS 336 iLab 7 of 7

cis 336 CIS/336 iLab 7 of 7 – SQL Course


Scenario/Summary

There is a lot more to a database than just tables and the data in them. A very important part of database security has to do with using and understanding Database Views. Being able to enhance the efficiency of the database tables by using additional indexes is also a very important aspect of database development. Finally, being able to create and use Database Sequences to automate some of the sequential processes in the database can not only save time but improve efficiency. In Lab 7, you will have a chance to work with all three of these areas.

General Lab Information and Considerations

This lab will utilize the same set of tables found in the script file (LeeBooks.SQL) that were used for Labs 4 through 6.

Each query in the script file you will create, must be numbered (use either –1 or REM 1 comments for numbering) and in order. The SQL for the following exercises should be written using notepad and run in SQL*Plus. Read each problem carefully and follow the directions as stated.

A Clean Script File:

A script file is meant to be like a program. The file can be run every time the code needs to be executed without having to retype the code again each time. For this reason, it is important that there are no errors in the code inside the file. You can go back and forth between notepad and Oracle when creating your script file to check your queries and verify if they work or not. However, you do not want to create your final output file until after you have verified that everything in your script is correct by running it in its entirety at least once and viewing the output. Once this has been done, you can create your final output file, with echo on to create the document, you can turn in with your lab. Remember in using a Spool Session, you must type “SPOOL OFF” at the SQL> PROMPT after your Script stops spooling to capture all of your data!

Lab Do’s and Don’t’s

Do Not include the LEEBOOKS.SQL as part of your lab script.

Do use Notepad to write your query script file.

Do Not write your queries in Word.

Do test each query before moving on to the next.

Do Not include extra queries for a problem unless the problem explicitly asks for more than one query.

Do test your queries before creating your final output file.

Do Not turn in a scrip file that has queries with errors.

Do number each query using either –1 or REM 1 comment notation.

Do Not start your query on the same line as the comment.

Do remember to check your final output and script file for accuracy.

Do Not turn in your lab without first checking your output file to verify that it is correct.

Things to keep in mind:

If you are not sure of the table names in your user schema, you can use the following select statement to list them.

SELECT * FROM TAB;

If you want to know the name of the columns in a particular table, you can use the following command to list them.

DESC

Making a script file containing a series of describe statements for each table and then spooling the output will give you a listing of all the tables with column names.

Be sure to review and verify your final output when you are finished. Do Not assume anything.

Write queries for each of the stated problems in the steps below that will return a result set of data to satisfy the requirements. When finished, your resulting output file should show both the query statement and result set for each query.

Deliverables

The deliverable for this lab will include:

Your script file with the seven queries and oneexplanation in it. Be sure your name, course number, and lab number are in a comment area at the top of your file.

An output file created using SET ECHO ON showing both the SQL code and the results. Be sure that you include your answer to question #3 as a comment in this file.

Both documents are to be zipped into a single file before submitting to the iLab Dropbox for Week 7.

L A B S T E P S    

STEP 1: 

Create a simple view named CUST_VIEW using the book_customer table that will display the customer number, first and last name, and the state for every customer currently in the database. Now insert the following data into the book_customer TABLE using an INSERT statement. (Do not use the View for this insert.) CUSTOMERID – 1021, FIRSTNAME – EDWARD, LASTNAME – BLAKE, STATE – TX. Now query your view and display the new record.

STEP 2:

Create a complex view named CUST_ORDER that will list the customer number, last name, and state from the BOOK_CUSTOMER table, in addition to the order number and order date from the BOOK_ORDER table. Insert the following data into this view (use the view for the insert statement): CUSTOMERID – 1022, LASTNAME – smith, STATE – KS, ORDERID – 1021, and ORDERDATE – 10-OCT-2004.

STEP 3:

In your own words, explain why the insert statement for the view you created in Step 2 did not work.

STEP 4: 

Create a sequence that can be used to assign a publisher ID number to a new publisher. Define the sequence to start with seven, increment by two, and stop at 1000. Name the sequence PUBNUM_SEQ.

STEP 5: 

Insert two new publishers into the PUBLISHER table, one named Double Week with a contact name of Jennifer Close at 800-959-6321, and the second one named Specific House with a contact name of Freddie Farmore at 866-825-3200. Use your new sequence to create the PUBID for each record. Now, query your PUBLISHER table to see your two new records.

STEP 6: 

Using a single query, query the PUBNUM_SEQ to determine what both the current sequence number is and the next sequence number will be.

STEP 7: 

Create a unique index on the combined columns ORDERID and CUSTOMERID in the BOOK_ORDER table. Give the index a name of BOOK_ORDER_IDX.

STEP 8: 

Determine how many objects you currently own in your schema by querying the USER_OBJECTS view in the Data Dictionary. Your result set should list the different object types that you find and include a count by object type.

 PRICE $ 19.99

           

CIS 336 iLab 6 of 7

cis 336 CIS/336 iLab 6 of 7 – SQL Course


Oracle Single Row and Group Functions

L A B O V E R V I E W         

Scenario/Summary

Lab #6 will introduce the various aspects of the Single-Row and Group Functions available in the Oracle Database. Most functions can be used in either the SELECT statement or the WHERE clause, but more commonly are used in the SELECT. Chapters 5 and 6 cover most all of the normal processing you use in these functions. In some cases, you will be asked to used more than one function within a single SELECT statement.

General Lab Information and Considerations

This lab will utilize the same set of tables found in the script file (LeeBooks.SQL) that were used for Labs 4 and 5.

Each query in the script file you will create must be numbered (use –1 comments for numbering) and in order. The SQL for the following exercises should be written using notepad and run in SQL*Plus. Read each problem carefully and follow the directions as stated.

A Clean Script File:

A script file is meant to be like a program. The file can be run every time the code needs to be executed without having to retype the code again each time. For this reason, it is important that there are no errors in the code inside the file. You can go back and forth between notepad and Oracle when creating your script file to check your queries and verify if they work or not. However, you do not want to create your final output file until after you have verified that everything in your script is correct by running it, in its entirety at least once and viewing the output. Once this has been done, you can create your final output file, with echo to create the document, you can turn in with your lab. Remember in using a spool session, you must type “SPOOL OFF” at the SQL> prompt after your script stops spooling to capture all of your data!

Lab Do’s and Don’t’s

•             Do Not include the LEEBOOKS.SQL as part of your lab script.

o             Do use Notepad to write your query script file.

•             Do Not write your queries in Word.

o             Do test each query before moving on to the next.

•             Do Not include extra queries for a problem unless the problem explicitly asks for more than one query.

o             Do test your queries before creating your final output file.

•             Do Not turn in a script file that has queries with errors.

o             Do number each query using – -1 comment notation.

•             Do Not start your query on the same line as the comment.

o             Do remember to check your final output and script file for accuracy.

•             Do Not turn in your lab without first checking your output file to verify that it is correct.

Things to keep in mind:

If you are not sure of the table names in your user schema, you can use the following select statement to list them.

SELECT * FROM TAB;

If you want to know the name of the columns in a particular table you can use the following command to list them.

DESC

Making a script file containing a series of describe statements for each table and then spooling the output will give you a listing of all the tables with column names.

Be sure to review and verify your final output when you are finished. Do Not assume anything.

Write queries for each of the stated problems in the steps below that will return a result set of data to satisfy the requirements. When finished, your script file should have a total of 13 queries, and your resulting output file should show both the query and result set for each.

Deliverables

Submit for grading:

1.            Your script file with the 13 queries in it. Be sure your name, course number, and lab number are in a comment area at the top of your file.

2.            An output file created using SET ECHO ON showing both the SQL code and the results.

3.            Both documents are to be zipped into a single file before submitting to the iLab Dropbox for Week 6.

L A B S T E P S      

STEP 1: 

Using the BOOK_CUSTOMER table and the NVL function, create a query that will return a list containing the customer number, first name, last name, and the characters ‘NOT REFERRED’ if the customer was not referred by another customer. Give the derived column an alias of REFERRED BY. Do not list any customers that were referred by another customer.

STEP 2:

Using the BOOKS table and the SUBSTR function, create a query that will return a list of book ISBN codes and the book title for all the computer books. Format the ISBN code to display as 9-999-99999-9 (e.g., 1059831198 would display as 1-059-83119-8)

STEP 3:

Using the BOOKS table, create a query using the correct functions to return the category name, the total retail of all books per category with a column alias of “Total Retail”, and the average retail of all the books per category with an alias of “Average Retail” for all categories with a total retail greater than $40.00. Format the total retail and average retail columns using the correct function to show dollars and cents with a dollar sign.

STEP 4:

Using the correct tables in your schema, create a query using either join operation you wish that will list the book title and number of authors for all books that have been written by more than one author. Give the title column an alias of “Book Title” and the column showing the number of authors an alias of “Number of Authors”.

STEP 5:

Using the BOOK_AUTHOR and AUTHOR tables for the upper most query, create a sub query that will return the BOOKID, and the first and last name of the author(s) who have written the book(s) that have been purchased the most. To successfully accomplish this, you will need to first find out the maximum total number of copies (based on quantity) sold of a book (based on bookid) in the ORDER_ITEMS table. This will be done in the bottom most query. The return from this query will be used to compare against the BOOKID in the ORDER_ITEMS table that occurs an equal number of times in the middle query. The return of this query will then be used to compare to a BOOKID related to an Author in the tables of the top most query. (HINT: Be careful, you will need both GROUP BY and HAVING clauses for your solution.)

STEP 6:

Using the correct tables, create a sub query using either join operation you wish that will list the customer number, first and last name concatenated together, and city for all customers who have placed an order for the most expensive book (based on retail price). Give the combined customer names column and alias of “Customer Name”.

STEP 7:

Using the ORDER_ITEMS table, create a query using the correct functions to return the item#, the total quantity of items ordered with an alias of “Total”, the average quantity per order with an alias of “Average” (since averages are often in decimals, only show two decimal places), the minimum quantity ordered with an alias of “Minimum”, and the maximum quantity ordered with an alias of “Maximum”. Your output results set should have five columns and four rows of data.

STEP 8:

Using the BOOKS table, create a query using the DECODE function that will display the book title, the published date, and the publisher name (this is where the decode function comes in). Give the publisher name column an alias of “Publisher Name”, and order the publisher names in descending order. The publisher names used should be the same as those in the PUBLISHER table. DO NOT join to the Publisher table for this query.

STEP 9:

Using the PUBLISHER table, create a query that will return a line of output like the one below for each record in the table. Be sure to use the correct functions in the SELECT statement, so that your output looks like the example below.

The contact person for Printing Is Us Publishing is Tommie Seymour.

Be sure to use the correct function to display the publisher name and publisher contact with only the first letter of each word capitalized.

STEP 10:              

Using the correct tables, create a query using the JOIN ON method to display a listing of all customers who have purchased more than two books. List the customer’s last name, the customer’s city and state, and the number of books they have purchased. Give the number purchased column and alias of “Number Purchased”.

STEP 11:              

Using only the BOOK table for the upper most statement, create a sub query that will update the retail price of all books published by PRINTING IS US by five percent (retail * 1.05). Remember, all you have is the publisher “name”. Use the sub query to find the publisher ID. To verify your update, provide a select statement on the BOOKS table before your update statement, and then a second select on the BOOKS table after the update. Once you have verified the results, you can issue a ROLLBACK statement to return the data to the original state.

STEP 12:              

Using the BOOK_CUSTOMER table, write a sub query that will return the names of those customers who were referred by the same individual who referred Jorge Perez. Do not display Jorge Perez’s name in the returned results (Hint: you should only have two customers displayed and the exclusion for Jorge Perez must be associated with the upper query).

STEP 13:              

Using the BOOKS table, create a query using the correct functions to return the category name, total number books per category with a column alias of “Category Total”, and the total cost of all the books per category with an alias of “Cost”. Format the cost column using the correct function to show dollars and cents with a dollar sign.

This is the end of Lab #6

 PRICE $ 19.99

           

CIS 336 iLab 5 of 7

cis 336 CIS/336 iLab 5 of 7 – SQL Course


Lab 5 of 7: Retreiving data from Multiple Tables (28 points)

L A B O V E R V I E W 

Scenario/Summary

Lab 5 deals with writing queries using multiple tables as covered in the reading and lecture material this week. In some cases, you will be given the option to write a query using either the TRADITIONAL method of joining tables or using the JOIN key word. In some cases, you will be asked to use a specific approach. Using the incorrect process when the process is specified will result in points being taken off for that problem.

The SELECT statement is the primary means of extracting data from database tables, and allows you to determine exactly which data you want to extract by means of different comparison operators used in the WHERE clause. This includes the use of specific “wild card” characters which allow you to search for character or number patterns within the data. You can also perform mathematical expressions within the SELECT statement to create derived output. The ORDER BY clause allows you to sort the output data in either ascending (the default) or descending order. Lab #5 will explore all of these applications of the SELECT statement.

General Lab Information and Considerations

This lab will utilize a set of tables found in the script file (LeeBooks.sql) found in the Doc Sharing area of the website. If you have not yet downloaded this file from Doc Sharing then do so now. Once you have downloaded the script file, import and run the script in SQL*Plus.

Each query in the script file you will create must be numbered (use –1 comments for numbering) and in order. The SQL for the following exercises should be written using notepad and run in SQL*Plus.

A Clean Script File:

A script file is meant to be like a program. The file can be run every time the code needs to be executed without having to retype the code again each time. For this reason, it is important that there are no errors in the code inside the file. You can go back and forth between Notepad and Oracle when creating your script file to check your queries and verify if they work or not, but you do not want to create your final output file until after you have verified that everything in your script is correct by running it, in its entirety at least once and viewing the output. Once this has been done, you can create your final output file, with echo on to create the document you can turn in with your lab. If using a Spool Session, be sure to type “SPOOL OFF” AT THE SQL> after your Script Stops Spooling!

Lab Do’s and Don’t’s

Do Not include the LEEBOOKS.SQL as part of your lab script.

Do use Notepad to write your query script file.

Do Not write your queries in Word.

Do test each query before moving on to the next.

Do Not include extra queries for a problem unless the problem explicitly asks for more than one query.

Do test your queries before creating your final output file.

Do Not turn in a script file that has queries with errors.

Do number each query using –1 comment notation.

Do Not start your query on the same line as the comment.

Do remember to check your final output and script file for accuracy.

Do Not turn in your lab without first checking your output file to verify that it is correct.

Things to keep in mind:

If you are not sure of the table names in your user schema, you can use the following select statement to list them.

SELECT * FROM TAB;

If you want to know the name of the columns in a particular table, you can use the following command to list them.

DESC

Making a script file containing a series of describe statements for each table and then spooling the output will give you a listing of all the tables with column names.

Be sure to review and verify your final output when you are finished. Do Not assume anything.

Write queries for each of the stated problems in the steps below that will return a result set of data to satisfy the requirements. When finished, your script file should have a total of 13 queries and your resulting output file should show both the query and result set for each.

Deliverables

Submit for grading:

Your script file with the 13 queries in it. Be sure your name, course number, and lab number are in a comment area at the top of your file. Submitting ONLY your spooled output will result in a 10-point deduction.

An output file created using SET ECHO ON showing both the SQL code and the results.

Both documents must be zipped into a single file before submitting to the iLab Dropbox for Week 5.

L A B S T E P S 

STEP 1:

Using the BOOKS and PUBLISHER tables, create a query using the traditional join method that will return a list containing the book title, publisher contact person, and publisher phone number for all publishers whose publisher name starts with an ‘R’.

STEP 2:

Using the DUAL table, create a query that will return the day of the week, hour, minutes, and seconds of the current date setting on a computer. The day should be in all upper case.

STEP 3:

Using the BOOK_CUSTOMER and BOOK_ORDER tables, create a query using the NATURAL JOIN method that will return a list containing the customer first name and last name and the order number for all orders that have been shipped. Give the customer name column an alias of “Customer Name” and order the output by the customer number in the BOOK_ORDER table in ascending order.

STEP 4:

Using the BOOK_ORDER table, create a query that will return the order number, order date, shipping address, city, state, and zip code for all orders going to Atlanta or Austin. Format the order date to display as Month DD, YYYY and give the column an alias of “Date Ordered”. Be sure the month begins with a capital letter.

STEP 5:

Using the BOOK_ORDER table, create a query using the correct function to return the order number, the date ordered, the date shipped, and a column representing the number of months between the two dates for all columns where a date shipped exists. Format the number returned from the function to display only two decimals, and give the column an alias of “Months Between”.

NOTE: Be sure that all of the numbers in the fourth column are positive numbers.

STEP 6:

Using the correct tables in your schema, create a query using either join operation that will list the title of each book and author name(s). Give the title column an alias of “Book Title”. Sort the results by title and then by author last name.

STEP 7:

Using the BOOKS table, create a query that will return the book title, cost, and retail price for all books with a title starting with the letter ‘H’. Use the correct conversion function to format the cost and retail columns to show dollars and cents with a dollar sign (e.g., a price of $25 would display $25.00 in the result set).

STEP 8:

Using the BOOK_ORDER, ORDER_ITEMS, and BOOKS tables, create a query using an OUTER JOIN operation that will list the book title, order date, and order number for all books in the BOOKS table. Order your output in descending order by ORDER_ITEMS.BOOKID. There are three books that have never been ordered which should show up at the top of your listing.

STEP 9:

Using the correct tables, create a query using the traditional join operation that will list the customer first and last name, book title, and order date (formatted as MM/DD/YYYY with an alias of “Order Date”) for all the customers who have purchased books published by ‘PRINTING IS US’.

STEP 10:

Using the BOOKS and ORDER_ITEMS table, write a query using the correct Relational Set Operator that will show all of the Book IDs in the BOOKS table that have not been ordered.

STEP 11:

Using the BOOK_CUSTOMER, BOOK_ORDER, ORDER_ITEMS, and BOOKS tables, create a query using traditional join conditions based on comparisons between primary and foreign keys that will list the customer number, first and last name, and book title. Limit your listing to only those books in the ‘FITNESS’ category.

STEP 12:

Using the BOOKS, ORDER_ITEMS, and BOOK_ORDER tables, create a query that will list the title, retail, quantity, and order date for all books ordered after April 30, 2009.

STEP 13:

Using the correct tables, create a query using either join operation you wish that will list the order id, order date, quantity ordered, and retail price for every book that has been ordered. Format the date as MM/DD/YYYY with an alias of “Order Date” and format the retail price column using the correct function to show dollars and cents with a dollar sign ( $ ) and a column alias of “Retail”.

This is the end of lab #5

 PRICE $ 19.99

           

CIS 336 iLab 4 of 7

cis 336 CIS/336 iLab 4 of 7 – SQL Course


Lab 4 of 7: Building the Physical Model

L A B O V E R V I E W  

Scenario/Summary

Lab #4 will introduce the various aspects of the SQL select statement and the methods of retrieving data from the database tables. The lab will utilize a set of tables found in the script file (LeeBooks.sql) found in the Doc Sharing area of the website. You will need to download the file, then run the script in your SQL*Plus session. These tables will be used for the remaining labs in this class.

The SELECT statement is the primary means of extracting data from database tables, and allows you to determine exactly which data you want to extract by means of different comparison operators used in the WHERE clause. This includes the use of specific “wild card” characters which allow you to search for character or number patterns within the data. You can also perform mathematical expressions within the SELECT statement to create derived output. The ORDER BY clause allows you to sort the output data in either ascending (the default) or descending order. Lab #4 will explore all of these applications of the SELECT statement.

General Lab Information and Considerations

Each query in the script file you will create must be numbered (use – -1 comments for numbering) and listed in order. The SQL for the following exercises should be written using Notepad and run in SQL*Plus. Read each problem carefully and follow the directions as stated.

A Clean Script File:

A script file is meant to be like a program. The file can be run every time the code needs to be executed without having to retype the code again each time. For this reason, it is important that there are no errors in the code inside the file. You can go back and forth between Notepad and Oracle when creating your script file to check your queries and verify if they work or not, but you do not want to create your final output file until after you have verified that everything in your script is correct by running it, in its entirety at least once and viewing the output. Once this has been done, you can create your final output file, with echo on to create the document you can turn in with your lab. Remember in using a spool session, you must type “SPOOL OFF” at the SQL> prompt after your script stops spooling to capture all of your data!

Lab Do’s and Don’t’s

Do Not include the LEEBOOKS.SQL as part of your lab script.

Do use Notepad to write your query script file.

Do Not write your queries in Word.

Do test each query before moving on to the next.

Do Not include extra queries for a problem unless the problem explicitly asks for more than one query.

Do test your queries before creating your final output file.

Do Not turn in a script file that has queries with errors.

Do number each query using – -1 comment notation.

Do Not start your query on the same line as the comment.

Do remember to check your final output and script file for accuracy.

Do Not turn in your lab without first checking your output file to verify that it is correct.

Things to keep in mind:

If you are not sure of the table names in your user schema, you can use the following select statement to list them.

SELECT * FROM TAB;

If you want to know the name of the columns in a particular table, you can use the following command to list them.

DESC

Making a script file containing a series of describe statements for each table and then spooling the output will give you a listing of all the tables with column names.

Be sure to review and verify your final output when you are finished. DO NOT assume anything.

Write queries for each of the stated problems in the steps below that will return a result set of data to satisfy the requirements. When finished, your script file should have a total of 13 queries and your resulting output file should show both the query and result set for each.

Deliverables

The deliverable for this lab will include:

Your script file with the 13 queries in it. Be sure your name, course number, and lab number are in a comment area at the top of your file.

An output file created using SET ECHO ON showing both the SQL code and the results.

Both documents are to be zipped into a single file before submitting to the iLab Dropbox for Week 4.

L A B S T E P S 

STEP 1:

Using the BOOKS table, write a query that will list the categories for the books in inventory. List each category only once in your result set.

STEP 2:

Using the BOOKS table, write a query that will list the title and publisher ID for each book in the table. Use the column heading of “Publisher ID” for the pubid field.

STEP 3:

Using the BOOKS table, write a query that will list the book title, retail price, and the amount of markup for each book. The amount of markup is the retail price minus the cost. Use the column heading “Price Markup” for the arithmetic expression column.

STEP 4:

Using the BOOK_CUSTOMER table, write a query that will list the customer’s first name, last name, and city for those customers living in zip code 31206.

STEP 5:

Using the BOOK_ORDER table, write a query that will list everything about the orders placed prior to April 2, 2009.

STEP 6:

Using the BOOK_ORDER table, write a query that will list everything about the orders that have not been shipped yet.

STEP 7:

Using the BOOK_CUSTOMER table, write a query using the AND and OR operators that will list the customer information for those customers living in either Florida or New Jersey who have not been referred by another customer.

STEP 8:

Using the BOOKS table, write a query that will list all information about those books that are not computer books and do not cost more than $30.00 retail.

STEP 9:

Using the AUTHOR table, write a query that will list all information about authors whose first name ends with an “A”. Put the results in descending order of last name, and then ascending order by first name. This should be done using a single query.

STEP 10:

Using the BOOK_ORDER table, write a query using the > and < operators that will list the orders that were placed between April 1, 2009 and April 4, 2009. Only show the orders for April 2nd and 3rd in your result set.

STEP 11:

Using the BOOK_ORDER table, write a query that will list the orders that were placed between April 2, 2009 and April 4, 2009 including those placed on the 2nd and 4th. Use a different approach (operator) in writing this query than used in the query for #10, that is, do not use > and < signs in your query.

STEP 12:

Using the BOOKS table, write a query that will list the book title, publisher ID, and published date for all books that were published by publisher 4 or after January 1, 2001. Order the results in ascending order by publisher ID and give the publish date and publisher ID columns meaningful titles.

STEP 13:

Many organizations use percentage of markup (e.g., profit margin) when analyzing financial data. To determine the percentage of markup for a particular item, simply subtract the cost for the item from the retail price to obtain the dollar amount of profit, and then divide the profit by the cost of the item. The resulting solution is then multiplied by 100 to determine the percent of markup. Using a SELECT statement, display the title of each book and its percent of markup. For the column displaying the percent of markup, use “Markup %” as the column heading.

This is the end of lab #4

 PRICE $ 19.99