Reading: Textbook Chapter 2, sections 2.1, 2.2, 2.3, and 2.4, and lecture slides covered.
Exercising: Complete the multiple choice questions in Textbook Section 2.12. The answers of the questions are available in course Web page.
Programming Assignment
For this assignment, you can use ASU General GNU GCC environment or Visual Studio. Please specify the environment that you use at the beginning of your program:
// State the IDE that you use: Visual Studio or GCC
If you use any other environment, please test it either using GCC or visual Studio before submission. If you do not specify the environment, the grader will use either GCC or Visual Studio, but not both. If you program does not compile or execute correctly, your grade will be deducted. GCC command to compile this program: gcc -std=c99 -o output hw03q1.c Execute with: ./output
- You are given hw03q1.c file, which contains a partially completed program. You are to follow the instructions contained in comments and complete the required functions. You will be writing functions for a program that does manipulation on 1-D and 2-D arrays. In one part, the program defines several common operations on 2D integer arrays (AKA matrices). In another function, you are asked to reverse one long user-input string and then count the number of occurrences of a character in that string. Example output given below. Go through the C file and see the sample expected output below. [50 points]
CSE240 HW3: 2D Integer Arrays
- 2 3 4 5
6 7 8 9 10
11 12 13 14 15
16 17 18 19 20
21 22 23 24 25
- 4 6 8 10
12 14 16 18 20
22 24 26 28 30
32 34 36 38 40
42 44 46 48 50
- 49 169 361 625
- 8 18 32 50
72 98 128 162 200
242 288 338 392 450
512 578 648 722 800
882 968 1058 1152 1250
1 36 121 256 441
4 49 144 289 484
9 64 169 324 529
16 81 196 361 576
25 100 225 400 625
1 4 9 16 25
36 49 64 81 100
121 144 169 196 225
256 289 324 361 400
441 484 529 576 625
CSE240 HW3: 2D Character Arrays Enter sentence with max 5 words: Did Tom eat the rat Reveresed string: tar eht tae moT diD No of occurences of a: 2 |
Note, when you create the Visual Studio project, the default location of project is similar to the file path shown in example figure above. For your convenience, you may change the project location while creating the project at the beginning in New Project dialog box.
Reviews
There are no reviews yet.