Discount CIS 170C CIS/170C CIS170C C++ All Weeks - All Labs 1 2 3 4 5 6 7 - An Original And A++ Work !!!
    CIS 170C CIS/170C CIS170C C++ All Weeks - All Labs 1 2 3 4 5 6 7 - An Original And A++ Work !!! CIS 170C CIS/170C CIS170C C++ All Weeks - All Labs 1 2 3 4 5 6 7 - An Original And A++ Work !!! CIS 170C CIS/170C CIS170C C++ All Weeks - All Labs 1 2 3 4 5 6 7 - An Original And A++ Work !!!

CIS 170C CIS/170C CIS170C C++ All Weeks - All Labs 1 2 3 4 5 6 7 - An Original And A++ Work !!!

$94.98
$131.92

Lab 1 of 7: Getting Started (Your First C++ Programs)                 

Lab Overview - Scenario/Summary

In general, this lab will instruct you on:

1.         how to create a project;

2.         how to enter and save a program;

3.         how to compile and run a program;

4.         how to, given a simple problem using input and output, code and test a program that meets the specifications; and

5.         how to debug a simple program of any syntax and logic errors.

Part A: Getting Started

Step 1: Start the Application

1.         From the File menu, choose "New Project."

2.         Choose “Win32 Console Application.”

3.         Enter a name in the name field.

4.         Click “Next” and choose the following options:

5.         Application Type: "Console Application"

6.         Additional options: Check mark “Empty project” and uncheck 8. Click Finish. Your project is now created.

Step 2: How to Add a Source Code File to Your Project (.cpp file)

1.         In the Solution Explorer, right-click on the “Source Files” folder and select "Add" and then "New Item."

2.         In the next dialog box, choose C++ file (.cpp), enter a name for your source code file, and press the Add button.

3.         Type or copy and paste your code into the newly created source code file. Build the file by pressing F7, and then execute your program by pressing CTRL-F5 (start without debugging) or use the F5 key (Start Debugging).

Step 3: Create a Source Code File

Now enter the following C++ program exactly as you see it. Use the tab where appropriate. [Note: C++ is case sensitive.] Instead of John Doe, type your name.

#include <iostream>

using namespace std;

void main()

{

  cout << "John Doe" << endl;

  cout << "CIS170C - Programming using C++\n";

  cout << "\n\n\nHello, world!\n\n";

 

}

When you execute a program in debug mode (F5), the console screen may appear and disappear

before you have an opportunity to view your output. There are several techniques you can use to

pause the console screen so you can read the output. On the very last line in the main() function:

a. insert the statement: system("pause");

-OR-

b. insert an input statement: cin << myVarable;

Step 4: Output

The black screen or console should read:

John Doe

CIS170C - Programming using C++

Hello, World        -  

Step 5: Save Program

Save your program by clicking File on the menu bar and then clicking Save Program.cpp, or by clicking the Save button on the toolbar, orCtrl + S.

Step 6: Build Solution

To compile the program, click Build on the menu bar and then click the Build Solution or Build LabA option. You should receive no error messages. If you see some error messages, check the code above to make sure you didn't key in something wrong. Once you make your corrections to the code, go ahead and click Build >> Build Solution again.

Step 7: Execute the Program

Once you have no syntax errors, to execute or run your program, click Debug on the menu bar, and then click Start Without Debugging.

Step 8: Capture the Output

Print a picture of your screen output. (Do a print screen and paste this into MS Word.)

Step 9: Print the Source Code

Copy your source code and paste it into the same Word document as your screen print. Save the Word Document asLab01A_LastName_FirstInitial

Note: Using the Visual Studio editor to compile your programs creates a lot of overhead. These additional files will become important as you create more sophisticated C++ projects. Projects can contain one or more source-code files. For this course, you will not have to worry about all the extra files that are created.

End of Part A

Part B: Calculate Total Tickets

Step 1: Create New Project

Now create a new project and name it LAB1B. Make sure you close your previous program by clicking File >> Close Solution.

Step 2: Type in Program

Like before, enter the following program. Type in your name for Developer and current date for Date Written.

// ---------------------------------------------------------------

 

// Programming Assignment:    LAB1B

 

// Developer:                 ______________________

 

// Date Written:              ______________________

 

// Purpose:                   Ticket Calculation Program

 

// ---------------------------------------------------------------

#include <iostream>

using namespace std;

void main()

{

      int childTkts, adultTkts, totalTkts;

      childTkts = 3;

      adultTkts = 2;

   totalTkts = childTkts + adultTkts;

   cout << totalTkts << endl;

}

Step 3: Save Program

Save your program by clicking File on the menu bar and then clicking Save Program.cpp, or by clicking the Save button on the toolbar, orCtrl + S.

Step 4: Build Solution

To compile the program, click Build on the menu bar and then click the Build Solution or Build LabB option. You should receive no error messages. If you see some error messages, check the code above to make sure you didn't key in something wrong. Once you make your corrections to the code, go ahead and click Build >> Build Solution again.

Step 5: Execute the Program

Once you have no syntax errors, to execute or run your program, click Debug on the menu bar, and then click Start Without Debugging

Step 6: Capture the Output

1.         Capture a screen print of your output. (Do a PRINT SCREEN and paste into an MS Word document.)

2.         Copy your code and paste it into the same MS Word document that contains the screen print of your output.

3.         3.     Save the Word Document as Lab01B_LastName_FirstInitial.

End of Part B

Part C: Payroll Program

Step 1: Create a New Project

Create a new project and name it LAB1C. Make sure you close your previous program by clicking File >> Close Solution.

Include a comment box like what you coded in Part B. This can go at the very top of your program.

Step 2: Processing Logic

You need to write a program that calculates and displays the take-home pay for a commissioned sales employee along with all of the deductions.

 

Input: Prompt the user for the weekly sales.

Process: Perform the calculations. The employee receives 7% of his or her total sales as his or her gross pay. His or her federal tax rate is 18%. He or she contributes 10% to his or her retirement program and 6% to Social Security.

Output: Display the results

Sample Output from Lab 1:

Enter Weekly Sales: 28000

 

Total Sales:       28000.00

Gross pay (7%):      1960.00

Federal tax paid:      352.80

Social security paid:    117.60

Retirement contribution:  196.00

Total deductions:      666.40

 

Take home pay:       1293.60

Press any key to continue . . .

 Pseudo Code:

 1.      Declare variables

1.         2.     Accept Input - weeklySales

2.         3.     Calculate Gross Pay = Weekly Sales * .07

3.         4.     Calculate Federal Tax = Gross Pay * .18

4.         5.     Calculate Social Security = Gross Pay * .06

5.         6.     Calculate Retirement = Gross Pay * .1

6.         7.     Calculate Total Deductions = Federal Tax + Social Security + Retirement

7.         8.     Calculate Total Take Home Pay = Gross Pay - Total Deductions

8.         9.     Display the following on separate lines and format variables with $ and decimal.

1.         a.     Total Sales Amount:        value of weekly sales

2.         b.     Gross Pay (.07):           value of gross pay

3.         c.      Federal Tax paid (.18):      value of federal tax

4.         d.     Social Security paid (.06):    value of social security

5.         e.     Retirement contribution (.1):  value of retirement

6.         f.       Total Deductions:          value of total deductions

7.         g.     Take Home Pay:           value of take home pay

Note: Use SetPrecisions(2) to format the output (see page 98 of the text). The statements should look something like the following:

 //include the iomanip header file at the top of the file

#include <iomanip>

//use fixed and setprecision(2) to format the number

//use setw(8) to control the width of the field

//use \t to control the spacing between fields

cout << fixed << setprecision(2);

cout << "Gross Pay (0.07):\t $" << setw(8) << grossPay << endl;

End of Part C

Lab 2 of 7: Decisions

Lab Overview - Scenario/Summary

You will code, build, and execute two programs requiring decisions. The first program will determine the smaller of two numbers input on the screen. The second program will calculate the shipping charge based on the purchase amount input on the screen. Learning outcomes: 1.   To be able to design program logic using either a flowchart or pseudocode 2. To be able to define and use data types 3.     To be able to prompt the user for input 4.      To be able to use the assignment statement for calculations 5.    To be able to display output to the console in a formatted manner 6.        To be able to debug a program of syntax and logic errors 7.  To be able to make decisions D.            Deliverables Section   Deliverable Points

Part A Step 7: Program Listing and Output   20

Part B  Step 7: Program Listing and Output   25

Lab Steps Preparation: If you are using the Citrix remote lab, follow the login instructions located in the iLab tab in Course Home. Locate the Visual Studio 2010 icon and launch the application.

Part A: Determine Smallest Number

Step 1: Requirements Write a program that inputs two numbers and determines which of the two numbers is the smallest. If the numbers are equal, display a message that they are equal. Sample output from program: You will be asked to enter two numbers. The smallest value will be displayed or a message if they are the same.

Please enter a numeric value: 4

Please enter a numeric value: 7

The smallest value is 4

Press any key to continue . . .

AND THEN: Please enter a numeric value: 7

Please enter a numeric value: 4

The smallest value is 4

Press any key to continue . . .

Step 2: Pseudocode

Using the pseudocode below, write the code that will meet the requirements:

Display description of program

Prompt the user for the first number

Prompt the user for the second number

If first number equals second number

Display the two numbers are equal

Else If first number is greater than second number

Assign second number to smallest

Else Assign first number to smallest

End-If

Display smallest number

End-If

******END*******

1.         Capture a screen print of your output. (Do a PRINT SCREEN and paste into an MS Word document.)

2.         Copy your code and paste it into the same MS Word document that contains the screen print of your output.

3.         Save the Word Document as Lab02A_LastName_FirstInitial.

END OF PART A

Part B: Calculate Shipping Charge

Step 1: Requirements Write a program that inputs the amount of the purchase and calculates the shipping charge based on the following table:

$0.00 – $250.00: $5.00

$250.01 – $500.00: $8.00

$500.01 – $1,000.00: $10.00

$1,000.01 – $5,000.00: $15.00

over $5,000.00: $20.00

Sample Output from Program:

Enter a purchase amount to find out your shipping charges.

Please enter the amount of your purchase: 234.65

The shipping charge on a purchase of $234.65 is $5.00.

Press any key to continue . . .

Step 2: Pseudocode Using the pseudocode below, write the code that will meet the requirements.

Display program information

Prompt the user for the sale amount

If sale amount > $5,000.00

shipping is $20.00

Else if sale amount > $1,000.00

shipping is $15.00

Else if sale amount > $500.00

shipping is $10.00

Else if sale amount > $250.00

shipping is $8.00

Else if sale amount > $0.00

shipping is $5.00

Else shipping is $0.00

End-If

If shipping is $0.00

Display “Error incorrect input”

Else

Display sale amount and shipping charge

End-If

Lab 3 of 7: Looping

Lab Overview - Scenario/Summary

You will code, build, and execute a program that will use looping to determine the score for a diver based on individual judge’s scores.

Learning outcomes:

1. Become familiar with the different types of looping structures.
2. Be able to debug a program of syntax and logic errors.
3. Be able to use the debug step-into feature to step through the logic of the program and to see how the variables change values.

D. Deliverables

Section Deliverable Points
Lab 3 Step 6: Program Listing and Output 45

E. Lab Steps

Preparation:
If you are using the Citrix remote lab, follow the login instructions located on the iLab tab in Course Home.

Locate the Visual Studio 2010 icon and launch the application.

Lab: DIVER Scoring Program

Step 1: Requirements – DIVER Scoring Program
Your State Dive Association presently scores its diving competitions with pencil and paper. They would like for you to design and develop a Dive Program in C++.
The paper forms that they presently use have the following:

Diver’s Name, City
JudgeScore1 – The scores entered are from 0 to 10.
JudgeScore2
JudgeScore3
JudgeScore4
JudgeScore5
DegreeOfDifficulty – This is assigned once for each diver.
OverAllScore – The overall score is the individual diver’s scores totaled and then divided by the degree of difficulty. The highest and lowest scores are removed as they are often skewed entries. Total the three scores left, divide them by 3, and then multiply that by the DegreeOfDifficulty. The degree of difficulty ranges from 1.00 to 1.67.

Display the diver’s information and overall score.
When the competition is complete, there is a summary report created that lists the total number of divers and the average of the overall scores.
Lab hints: When writing this lab, use nested loops. A nested loop is when one loop is completely contained in another loop. In an inner loop, you will read the five scores one at a time. Every time you read the score (in the loop), you will compare the score to the highest so far and also to the lowest so far so you can determine the highest and lowest scores, in addition to adding the scores up one at a time.
You also need to have your program process multiple divers. Put this in an outer loop. After you process the information for one diver, prompt the user if she/he wants to process another diver. Allow the user to type either a “Y” or “y” to enter another diver’s information; otherwise, exit the loop. Write an event summary by calculating and displaying the average score for all divers and the total number of divers participating.
Garbage in Garbage Out (GIGO): The data being entered by the user needs to be validated. Scores by judges may range between 0 and 10. If the user enters an invalid score, display an error message, and prompt for the score again. Keep doing this until the user enters the score correctly. The degree of difficulty may range from 1.00 to 1.67.
Sample output from program
Report to the media
Event: Diving competition

Enter the diver’s name: Sue Jones
Enter the diver’s city: Dallas
Enter the score given by judge #1: 45
Invalid score – Please reenter (Valid Range: 0 – 10)
Enter the score given by judge #1: 3
Enter the score given by judge #2: 4.5
Enter the score given by judge #3: 6.7
Enter the score given by judge #4: 89
Invalid score – Please reenter (Valid Range: 0 – 10)
Enter the score given by judge #4: 8
Enter the score given by judge #5: 9.2
What was the degree of difficulty? 1.9
Invalid degree of difficulty – Please reenter (Valid Range: 1 – 1.67)
What was the degree of difficulty? 2
Invalid degree of difficulty – Please reenter (Valid Range: 1 – 1.67)
What was the degree of difficulty? 1.2

Diver: Sue Jones, City: Dallas
Overall score was 7.68

Do you want to process another diver (Y/N)? y

Enter the diver’s name: Dave Smith
Enter the diver’s city: Houston
Enter the score given by judge #1: 5.7
Enter the score given by judge #2: 6.8
Enter the score given by judge #3: 7.6
Enter the score given by judge #4: 8.7
Enter the score given by judge #5: 6.7
What was the degree of difficulty? 1.1

Diver: Dave Smith, City: Houston
Overall score was 7.74

Do you want to process another diver (Y/N)? n

EVENT SUMMARY
Number of divers participating: 2
Average score of all divers: 7.71
Press any key to continue . . .
Step 2: Processing Logic
Using the pseudocode below, write the code that will meet the requirements.

Write report heading

Loop as long as there are divers to process
Input diver’s name and city
Initialize highest score, lowest score and total score

Using a do-while loop input the 5 judge’s scores
Validate the score to ensure it is between 0 and 10
Add score to total
Determine highest and lowest scores

Input and validate the degree of difficulty
Calculate the overall diver’s score

Display the diver’s information and overall score
Add diver’s overall score to the final score
Add 1 to the number of divers

Prompt the user if she wants to process another diver
End-Loop

Calculate the average score for all divers
Display the number of divers and the average score for all divers

Step 3: Create a New Project
Create a new project and name it LAB3.
Write your code using the Processing Logic in Step 2. Make sure to save your program.

Step 4: Build Solution
To compile the program, click Debug then Build solution (F7). You should receive no error messages. If you see some error messages, check the code above to make sure you didn’t key in something wrong. Once you make your corrections to the code, go ahead and click Build >> Build Solution again.

Step 5: Execute the Program
Once you have no syntax errors, to execute or run your program, click Debug on the menu bar and then click Start Debugging.
Step 6: Capture the Output

1. Capture a screen print of your output. (Do a PRINT SCREEN and paste into an MS Word document.)
2. Copy your code and paste it into the same MS Word document that contains the screen print of your output.
3. Save the Word document as Lab03_LastName_FirstInitial.
END OF LAB

 

Lab 4 of 7: Methods

Lab Overview - Scenario/Summary

You will code, build, and execute a program that simulates the dialing of a phone using methods.

Deliverables

Submit the following to this week’s Dropbox:

•           A zipped Visual Studio project folder for each programming exercise. Refer to the Deliverables section of the Week 1 iLab page for detailed instructions on how to zip a project folder.

•           A single MS Word file named YourLastName_Lab1_ex1.docx containing the following items:

o          The source code for each program in the lab: Your source code should use proper indentation, include meaningful comments, and be error free. Start each with a specification that includes your name, the lab and exercise number, and a description of what the program accomplishes, similar to this:

/* Specification:

First Name Last Name

Lab 1 Exercise #

This program does X */

o          Labeled screenshot(s) of the output windows for each program, showing that each program produces correct results

NOTE: A screenshot of a window can be created by first clicking on it to activate it. Next, press the key or key combination your specific computer uses to do a “print screen” (typically the Prnt Scrn or Prnt key in combination with the ctrl or FN key). Then, click the MS Word “paste” option to paste the screenshot into the MS Word file.

Objectives and Grading

Lab Objectives:

•           Distinguish between by value, by ref, and out parameter types.

•           Call class methods using by value, by ref, and out parameters.

•           Write your own class methods using by value, by ref, and out parameters.

•           To be able to define and use global named constants

•           To be able to debug a program of syntax and logic errors

•           To be able to use the debug step-into feature to step through the logic of the program and to see how the variables change values

Your lab grade will be based upon:

•           the formatting of your source code;

•           the use of meaningful identifiers;

•           the extent of internal documentation; and

•           the degree to which an exercise’s specifications are met.

Preparation:

If you are using the Citrix remote lab, follow the login instructions located in the iLab tab in Course Home.

iLab Steps

Step 1: Requirements – Phone Dialing Program

Your mission: A prepaid phone service needs a program that converts alphanumeric keyboard input into a phone number. The user will input eight characters and the program will output either an error message or the translated seven-digit phone number. The input may contain digits, letters, or both. Letters can be uppercase or lowercase.

The program will perform the conversion per a standard telephone keypad layout.

0          5         J K L

1          6         M N O

2          A B C  7          P Q R S

3          D E F   8          T U V

4          G H I   9          W X Y Z

The program implements the following methods.

•           Main(): Declares seven character variables and passes these to the following methods by reference:

o          ProcessInput(): gets user input and performs the conversion

o          ShowResults(): displays the results

•           GetInput(): Gets seven characters from the user and stores them into the seven variables Main() has passed by reference.

•           ProcessInput(): Calls ToDigit() for each, passing each character variable by reference, and returns one of these codes to Main() by value:

o          0 if there were no input errors

o          -1 if there were input errors

Input errors include the following:

•           The first character is 0 (seven-digit phone numbers can’t start with 0).

•           The first three characters are “555″ (no phone numbers start with 555).

•           Any character is not a digit or an uppercase or lowercase letter.

•           ToDigit(): Converts a character (passed by reference) to its corresponding digit per the table above, and returns one of these codes to ProcessInput() by value:

o          0 if the character is valid (a digit or uppercase or lowercase letter)

o          -1 if the character is not valid

•           ShowResults(): Writes converted telephone number to the screen, inserting a dash (-) between the third and fourth digits, and accepts the seven character variables from Main() by reference.

Sample Output:

Enter a 7 character phone number: 2132121

The converted phone number is: 213-2121

Enter a 7 character phone number: 2scdfER

The converted phone number is: 272-3337

Enter a 7 character phone number: 555resw

Invalid input, please try again.

Enter a 7 character phone number: 0988765

Invalid input, please try again.

Enter a 7 character phone number: 12345678

Invalid input, please try again.

Enter a 7 character phone number: @34*uy

Invalid input, please try again.

Tips

Best practice: Don’t try to write too much at a time! First, write an outline in comments based on the requirements and the pseudocode. Then, implement declaring seven char variables. Make sure to fix any compiler errors before implementing more. Then, write and call an empty GetInput() method that accepts parameters, but does nothing but return a dummy value. Make sure you can pass the seven character variables by reference without compiler errors before implementing any of the GetInput() logic. Keep working incrementally like this, testing as you go. Set breakpoints and use the debugger at each phase to make sure your logic is working correctly. Then, use the same approach to implement the other methods. Test each phase with valid input before handling any invalid conditions.

Pseudocode

•           ProcessInput( ) Method

o          Get 7 characters from the user and store them in the 7 variables that Main() has passed by reference

o          Call ToDigit() for each of the 7 characters

         If toDigit returns an error code (-1), return an error code (-1)

o          If the first character is 0, return an error code (-1) to Main()

o          If the first three characters are 555, return an error code (-1)

o          If there are no errors, return 0

•           ToDigit ( ) Method

o          Convert the characters (passed from ProcessInput() by reference) to upper case

o          Use a switch statement to translate characters into their corresponding digits.

         Write a case statement for each digit and for each valid uppercase letter

         Write a default case that returns an error code (-1) for invalid letters

o          If there are no invalid letters, return 0

•           ShowResults ( ) Method

o          Display the Phone Number using the character variables Main() has passed by reference

•           Main() Method

o          Declare 7 char variables

o          Get user input by calling the GetInput() method, passing it the 7 variables by reference

o          Perform the conversion by calling the ProcessInput( ) method, passing it the 7 variables by reference

o          Display an error message or call ShowResults(), depending on the code ProcessInput() returns

END OF LAB

Lab 5 of 7: Array and String

Lab Overview - Scenario/Summary

Video Game Player Program:  Determine the average score for a group of players and then determine who scored below average.

Part A: Video Game Player Program

Step 1: Requirements

Write a program to do the following:

In main, declare a PlayerName Array and a Score Array. Declare the size of the arrays to be 100.

In the InputData function, input the player name and score into the arrays for an unknown number of players up to 100. 

In the DisplayPlayerData function, display the name and score of each player.  Numberofplayers

In the CalculateAverageScore function, calculate the average score and return it by value.  numberofplayers

In the DisplayBelowAverage function, display the name and score for any player who scored below the average. Do not use global variables.

 

Number of players

Output from Program:

Enter Player Name (Q to quit): Bob

Enter score for Bob: 3245

Enter Player Name (Q to quit): Sue

Enter score for Sue: 1098

Enter Player Name (Q to quit): Dave

Enter score for Dave: 8219

Enter Player Name (Q to quit): Pat

Enter score for Pat: 3217

Enter Player Name (Q to quit): Q

   Name   Score

Bob        3245

Sue        1098

Dave       8219

Pat        3217

Average Score: 3944.75

 Players who scored below average

  Name    Score

Bob        3245

Sue        1098

Pat        3217

Press any key to continue . . .

Here is compelete solution for CIS 170C course - Visual C++

My solution contain Visual C++ projects - Documents and Detailed comments.

Please using Visual Studio 2010 to open this project.

If you have more question or need help, please contact me via email support@extutorials.com. I will help you any time.

Thank you !

Attached Files

Move over [ preview ] file name to preview content in it!

Write a review

Your Name:


Your Review: Note: HTML is not translated!

Rating: Bad           Good

Enter the code in the box below:



PURCHASE SAVE
2 Tutorials 10%
3 Tutorials 13%
4 Tutorials 16%
5 Tutorials 19%
6 Tutorials 22%
7 Tutorials 25%
8 Tutorials 28%
9 Tutorials 31%
10 Tutorials 34%
add url more

9MZQASHWN73B