SophiaPretty

(5)

$14/per page/Negotiable

About SophiaPretty

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Accounting,Algebra See all
Accounting,Algebra,Applied Sciences,Architecture and Design,Art & Design,Biology,Business & Finance,Calculus,Chemistry,Communications,Computer Science,Economics,Engineering,English,Environmental science,Essay writing Hide all
Teaching Since: Jul 2017
Last Sign in: 314 Weeks Ago
Questions Answered: 15833
Tutorials Posted: 15827

Education

  • MBA,PHD, Juris Doctor
    Strayer,Devery,Harvard University
    Mar-1995 - Mar-2002

Experience

  • Manager Planning
    WalMart
    Mar-2001 - Feb-2009

Category > Computer Science Posted 09 Dec 2017 My Price 10.00

programming with C++.The purpose of this three-part lab

I need just part c of the project done. It would be nice if this could get done asap. I will tip big if done quickly. thanks in advance

 

Student Lab Activity

 

 

CIS170C Week 1 Lab Instructions

 

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

 

Lab Overview—Scenario/Summary

 

Welcome to programming with C++.The purpose of this three-part lab is to walk you through the following tutorial to become familiar with the actions of compiling and executing a C++ program.

 

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.

 

Deliverables

 

Section

Deliverable

Points

Part A

Step 6: Program Listing and Output

10

Part B

Program Listing and Output

10

Part C

Program Listing and Output

20

All Parts

Total

40

 

Lab Steps

 

Preparation:

 

If you are using the Citrix remote lab, follow the login instructions located in the lab (under General Resources within Course Resources) in Course Home.

 

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 OK.
  5. Click Next, and choose the following options.
  6. Application Type: Console Application
  7. Additional options: Check mark Empty project.
  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 NewItem.
  2. In the next dialog box, choose C++ file (.cpp), enter a name for your source code file, and press theAdd button.
  3. Type or copy and paste your code into the newly created source code file. Build the file by pressingF7, 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.

 

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

// Programming Assignment:      LAB1A

// Developer:                             ______________________

// Date Written:                          ______________________

// Purpose:                                            Ticket Calculation Program

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

#include<iostream>

 

usingnamespace std;

 

void main()

{

 

            cout <<"John Doe ticket program\n";

 

            int childTkts, adultTkts, totalTkts;

            cout <<"Please enter the number of child tickets:";

            cin >> childTkts;

            cout <<"Please enter the number of adult tickets:";

            cin >> adultTkts;

            totalTkts = childTkts + adultTkts;

 

            cout <<"The total tickets are: "<<totalTkts << endl;

           

 

 

}

 

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

 

Step 5: Save Program

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

 

Step 6: Build Solution

To compile the program, click Build on the menu bar, and then click the BuildSolution 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 as Lab01_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: Debugging a program

 

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.

 

This program has three errors.

 

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

// Programming Assignment:      LAB1B

// Developer:                             ______________________

// Date Written:                          ______________________

// Purpose:                                            Average Program

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

#include<iostream>

 

usingnamespace std;

 

void main()

{

 

            cout <<"Find the Average Program\n";

 

            double num1, num2, num3, average;

            cout <<"Please enter number 1: ";

                        cin >> num1;

                        cout <<"Please enter number 2: "

                        cin << num2;

                        cout <<"Please enter number 3: ";

                        cin >> num3;

                        average = num1 + num2 + num3 / 3;

 

            cout <<"The average is:  "<< average << endl;

            system("pause");

 

 

 

}

When you build the solution you will see the debugger. Double click on an error to locate the error. If it is a syntax error, the error will be listed in the error list. Some errors will be underlined in red. Once you fix the syntax errors, use the F11 (step into code) and F10 (step over code) commands to locate the logic error in the code.

 

 

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, or Ctrl + S.

 

 

Step 4: Build Solution

 

To compile the program, click Build on the menu bar, and then click the BuildSolution 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 the Word document from Part A.)

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

3.     List all three errors.

4.     Save this in the same Word document as Part JA.

 

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 revenue earned from ticket sales at a movie theater.

 

Input:Prompt the user for the number of adult tickets. Prompt the user for the number of child tickets.

Process:Perform the calculations.The adult tickets cost $10.00 and the child tickets cost $6.00. The theater keeps 20% of the gross box office profit, and the rest goes to the movie distributor.

Output:Display the results.

Sample Output from Lab 1:



Flowchart: (continued on next page)

 

 

Pseudo Code:

 

1.      Declare variables

2.     Accept Input –child tickets and adult tickets

3.     CalculateChild ticket total = child tickets* 6

4.     Calculate adult ticket total = adult tickets * 10

5.     Calculate gross profit = child ticket total + adult ticket total

6.     Calculate net profit = gross profit *0.2

7.     Calculate distributor amount = gross profit – net profit

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

a.     Gross Profitvalue of gross profit

b.     Net Profitvalue of net profit

c.     Distributor Amountvalue of distributor amount

 

//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 Profit :\t $"<< setw(8) << grossProfit<< 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, or Ctrl + S.

 

Step 4: Build Solution

To compile the program, click Build on the menu bar and then click the BuildSolution, or Build LabC 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.     Use the same Word document as Part A and B.

 

End of Part C

END OF LAB

 

Attachments:

Answers

(5)
Status NEW Posted 09 Dec 2017 06:12 AM My Price 10.00

-----------  ----------- H-----------ell-----------o S-----------ir/-----------Mad-----------am ----------- Th-----------ank----------- yo-----------u f-----------or -----------you-----------r i-----------nte-----------res-----------t a-----------nd -----------buy-----------ing----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n. -----------Ple-----------ase----------- pi-----------ng -----------me -----------on -----------cha-----------t I----------- am----------- on-----------lin-----------e o-----------r i-----------nbo-----------x m-----------e a----------- me-----------ssa-----------ge -----------I w-----------ill----------- be----------- qu-----------ick-----------ly

Not Rated(0)