The objective of this homework is to get familiar with the editing and compilation environment, modify a simple C++ program, design a Struct and implement it in a C++ program, prepare a well documented report and submit to the lab instructor.
Task 1: Familiarize yourself with the IDE.
- Download and install the IDE of your choice. In case you have not chosen any IDE yet, try downloading Visual Studio. The community edition is located at
https://www.visualstudio.com/downloads/. Make sure you include the C++ language during the setup.
- Create a new project. You can name this whatever you like (but a descriptive naming is recommended).
- Try to use the code from Gaddis program 8-6 as our first example. You may find that the source code of the text can be found and be downloaded from http://wps.pearsoned.com/ecs_gaddis_sowcpp_cs_8/244/62625/16032053.cw/index.html.
- Create a breakpoint on line 41 and step through the code until you have displayed two rows of products on the screen.
- Take a screen shot of the output screen and the IDE to include in your lab report. Task 2:
- Create a new project.
- Copy the provided code from the file Lab1-Task2.cpp into your project.
- Compile and run the code.
- Your user has noted the following errors. Fix them.
- The division in the output is incorrect
- The amounts in the division are incorrect. One of the values is a really large negative number that looks like garbage.
- The total is 0 but it shouldnt be.
- Submit the corrected source code and include a screen shot of the output in your lab report.
Task 3: Structures.
- Browse Chapter 11(Sections 1 through 5) of Gaddis text on structured data.
- Reuse the project from task 1.
- Create a structure to replace the 4 arrays in the program (id, units, prices, sales).
- Modify the code in the main function to have a single products array of type defined in step 2.
- Modify the code in the rest of the program to use the single products array rather than the 4 original arrays.
- Submit your working (meaning you tested and removed all bugs) code and include a screen shot of the output in your lab report.

![[Solved] CS2028 Lab 1-IDE, Debugging, Arrays and Structs](https://assignmentchef.com/wp-content/uploads/2022/08/downloadzip.jpg)

![[Solved] CS2028 Homework 1-Files and Structures](https://assignmentchef.com/wp-content/uploads/2022/08/downloadzip-1200x1200.jpg)
Reviews
There are no reviews yet.