Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C# source code please (not C++ or pseudo) Lab 7A: Thank you, Grace Hopper. You may have heard the story, but the programming term bug

image text in transcribed

C# source code please (not C++ or pseudo)

Lab 7A: Thank you, Grace Hopper. You may have heard the story, but the programming term "bug" is attributed to the computer legend Grace Hopper who, after diagnosing the problem with a program, determined it was because a bug (in this case, a moth) physically wedged itself under a vacuum tube - causing the machine to no longer work. We've come a long way since then... For this part of the lab, you are going to write a program, then show what it looks like using the debugger. So, in addition to your code, you're going to have to submit a screenshot of the debugger. Part 1) Writing the Program: Write a program that prompts the user for the size of an integer array, declare an array of that size then populate each cell of the array with the square of the cell's index. For example, cell 0 = 0, cell 1 = 1, cell 2 = 4, cell 3 = 9. The program will then print out the contents of the array separated by the pipe" symbol (this symbol above the "Enter" key). The contents need to be printed out on a single line as shown in the sample output below. User input is denoted in bold. If you are using C++, please see the appendix for example code of creating an array based on a user variable. Part 2) Using the debugger: For this part of the assignment, it is important that you watch the debugger tutorial video in the introduction of this assignment. After you finish creating your program and it is working, you need to set a breakpoint in your code then start walking through the code. For simplicity, we recommend that you set the breakpoint at the line of code that is printing out each cell. Right before the program is finished, show the array in the debuggerwith each cell holding the correct value (i.e. expand the array in the debugger, just like in the tutorial video). Take a screenshot of this and save it to your desktop. To get credit for this assignment, you need to submit your code and the screenshot. Sample #1: Enter the size of the array: 5 10|1|4|9/16 Sample #2: Enter the size of the array: 14 10|1|49|16|25|36|49|64|81|100121|144169

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions