22.03.2016 Views

DEVRY COMP 220 iLab 2 Resistor Lab Report and Source Code

comp 220,comp 220 entire course,comp 220 devry,devry comp 220,comp 220 lab 2 source code,comp i lab report,devry comp 220 ilab 2 report and source code,devry comp 220 ilab 2 report source code,comp 220 ilab 2 lab report and source code

comp 220,comp 220 entire course,comp 220 devry,devry comp 220,comp 220 lab 2 source code,comp i lab report,devry comp 220 ilab 2 report and source code,devry comp 220 ilab 2 report source code,comp 220 ilab 2 lab report and source code

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>DEVRY</strong> <strong>COMP</strong> <strong>220</strong> <strong>i<strong>Lab</strong></strong> 2 <strong>Resistor</strong> <strong>Lab</strong> <strong>Report</strong><br />

<strong>and</strong> <strong>Source</strong> <strong>Code</strong><br />

Check this A+ tutorial guideline at<br />

http://www.assignmentcloud.com/comp-<br />

<strong>220</strong>/comp-<strong>220</strong>-ilab-2-resistor-lab-report<strong>and</strong>-source-code<br />

For more classes visit<br />

http://www.assignmentcloud.com<br />

Scenario <strong>and</strong> Summary<br />

This lab requires you to create a multifile C++ project in order to design <strong>and</strong><br />

implement an object-oriented program using a class to model the characteristics <strong>and</strong><br />

function of a resistor.<br />

Deliverables<br />

Submit a single Notepad file containing the source code for Exercise 1 to the Dropbox<br />

for Week 2. Your source code should use proper indentation <strong>and</strong> be error free. Be<br />

sure that your last name <strong>and</strong> the lab number are part of the file name; see the<br />

following example: YourLastName_<strong>Lab</strong>1.txt.<br />

Each program should include a comment section that includes (at a minimum) your<br />

name, the lab <strong>and</strong> exercise number, <strong>and</strong> a description of what the program<br />

accomplishes. Submit a lab report (a Word document) containing the following<br />

information to the Dropbox for Week 2. Include your name <strong>and</strong> the exercise number.<br />

Specification: Include a brief description of what the program accomplishes,<br />

including its input, key processes, <strong>and</strong> output. Test Plan: Include a brief description


of the method you used to confirm that your program worked properly. If necessary,<br />

include a clearly labeled table with test cases, predicted results, <strong>and</strong> actual results.<br />

Summary <strong>and</strong> Conclusions: Include a summary of what the lab demonstrated <strong>and</strong> any<br />

conclusions drawn from the testing of the lab program. Answers to <strong>Lab</strong> Questions:<br />

Answer any <strong>and</strong> all lab questions included in the lab steps.<br />

Summary: Write a statement summarizing your predicted <strong>and</strong> actual output. Identify<br />

<strong>and</strong> explain any differences.<br />

Conclusions: Write at least one nontrivial paragraph that explains, in detail, either a<br />

significant problem you had <strong>and</strong> how you solved it or, if you had no significant<br />

problems, something you learned by doing the exercise.<br />

Each lab exercise should have a separate section in the lab-report document.<br />

Your lab grade will be based upon<br />

the formatting of your source code; the use of meaningful identifiers; the extent of<br />

internal documentation; the degree to which an exercises’ specifications are met;<br />

<strong>and</strong> the completeness of your lab report.<br />

i L A B S T E P S<br />

STEP 1: Create a Multifile Project<br />

Objective: Create a C++ console application that will model the characteristics of a<br />

resistor.<br />

Create a multifile project. Create <strong>and</strong> add to the project an h file containing the<br />

resistor-class definition. Create <strong>and</strong> add to the project a cpp file containing the<br />

implementation of the class-member functions. Create <strong>and</strong> add to the project a ccp<br />

file containing the main() function, which will instantiate a resistor object <strong>and</strong> test<br />

its member functions.<br />

STEP 2: Required Class Members<br />

The resistor class will, at minimum, have members that do the following.<br />

store the nominal resistance value of a resistor store the tolerance of a resistor<br />

initialize any <strong>and</strong> all nominal-resistance values to correct, EIA, nonzero values that<br />

are greater than 0 <strong>and</strong> less than 1,000,000 ohms initialize any <strong>and</strong> all resistancetolerance<br />

values to correct, E12, E24, E48, or E96 resistance-tolerance values allow<br />

the nominal-resistance <strong>and</strong> tolerance values of a resistor object to be changed by the<br />

user All member functions should have a test message stating the name of the<br />

function. All the test messages should be displayed or not displayed, depending on<br />

the value of a Boolean variable declared in main(). If the Boolean , display the<br />

message. If the Boolean , do not display the message.


STEP 3: Program Operations<br />

Function main() should instatiate two objects of class resistor. Function main()<br />

should display the current values of all resistor objects. Function main() should also<br />

calculate <strong>and</strong> display the minimum <strong>and</strong> maximum in-tolerance resistance values of<br />

each resistor object from the resistor data members. Function main() should allow<br />

the user to change the values of the nominal resistance <strong>and</strong> the resistor tolerance of<br />

both resistor objects, <strong>and</strong> it should also correctly h<strong>and</strong>le out of numeric-range input.<br />

Main() is also responsible for making sure that the user can successfully enter only<br />

correct, EIA resistance <strong>and</strong> tolerance values. The user should be given the following<br />

data-entry choices: accept current EIA values for resistance <strong>and</strong> tolerance; The<br />

function main() should display the new, modified values of the resistor object,<br />

including the new min <strong>and</strong> max in-tolerance resistance values. The function main()<br />

should be executed twice: once with the test messages displayed <strong>and</strong> once without.<br />

STEP 4: <strong>Lab</strong> Questions<br />

You are not required to copy the question text into your document, but all answers<br />

should be listed with the question number they answer.<br />

List the complete reference-source information for where you found the EIA<br />

st<strong>and</strong>ard resistor value <strong>and</strong> tolerance information. How was this reference<br />

discovered <strong>and</strong> where? The constructor requires the initialization values for the<br />

nominal resistance <strong>and</strong> the tolerance when an object is instantiated to be a correct E-<br />

series resistance <strong>and</strong> tolerance combination. Describe how this was accomplished in<br />

your program design <strong>and</strong> implementation. In the lab, you were required to provide<br />

mutator functions to change the nominal-resistance <strong>and</strong> tolerance values of a<br />

resistor object. Describe how this was accomplished so that the user could not enter<br />

an invalid nominal-resistance <strong>and</strong> E-series tolerance combination. Describe how this<br />

process was different <strong>and</strong>/or similar to how you implemented this validation in the<br />

class constructor.

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

Saved successfully!

Ooh no, something went wrong!