$30
CSE 240 Pointer Operations Homework 4, (50 points)
Introduction
The aim of this assignment is to make sure that you understand and are familiar with the concepts covered in the lectures, including basic C syntax, using pointers to access strings and multidimensional arrays. By the end of the assignment, you should have
● understood the concepts of data, data declaration, forward declaration, and manipulation of values stored in the memory.
● written a program using pointers to access a variety of other data structures.
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.
You are expected to do the majority of the assignment outside the class meetings. Should you need assistance, or have questions about the assignment, please contact the instructor or the TA during their office hours.
You are encouraged to ask and answer questions on the course discussion board. However, in do not share your answers or code in the course discussion board. Do not cooperate with your peers in doing the individual assignments.
Programming Assignment
1. You are given a C file hw04q1.c which contains a partially completed program. Follow the instructions contained in comments and complete the required functions. You will be writing most functions (initializeStrings, printStrings, toUppercase, toLowercase, changeAllToUpperOrLower, wordMatch, concatStr) using only pointer operations instead of using array operations. In this homework, the arrays in all functions need to be accessed with pointer, not as array. It means you cannot use an array element value through indexing like s[0][0] or s[i][j]. However, you can use the addresses of some array elements, such as &s[0][0] and &s[i][0]. Then, you use the pointer to access the array element value. You will be using a character pointer. You may use only the strlen( ) function from string.h library. You can find out more about these functions by reading through the instructions in the hw04q1.c file. Example output is given below.
What to Submit?
You are required to submit your solution in a compressed format (.zip). Make sure your compressed file is label correctly - lastname_firstname4.zip. (All lowercase, do not put anything else in the name like "hw4".)
The compressed file MUST contain the following:
hw04q1.c (completed code)
No other files should be in the compressed folder.
If multiple submissions are made, the most recent submission will be graded. (Even if the assignment is submitted late.)
Submission preparation notice: The assignment may consist of multiple files. You must copy these files into a single folder for Canvas submission. To make sure that you have all the files included in the zip file and they work after unzip operation, you must test them before submission. You must also download your own submission from the blackboard. Unzip the file on a different machine and test your assignment and see if you can open and test the files in a different location, because the TA will test your application on a different machine. If you submitted an empty project folder, an incomplete project folder, or a wrong folder, you cannot resubmit after the submission linked is closed! We grade only what you submitted in the blackboard. We cannot grade the assignment on your computer or any other storage, even if the modification date indicated that the files were created before the submission due dates. The blackboard submission may take a few minutes. Be patient and wait for it to complete.
Where to Submit?
All submissions must be electronically submitted to the respected homework link in the course web page where you downloaded the assignment.
Late submission deduction policy
● No penalty for late submissions that are received within 24 hours after the deadline; ● 10% grade deduction for every day it is late after the grace period; ● No late submission after Tuesday at 11:59PM.
Grading Rubrics
Each sub-question (programming tasks) has been assigned certain points. We will grade your programs following these steps:
(1) Compile the code. If it does not compile, 50% of the points given for the code under compilation will be deducted. Then, we will read the code and give points between 50% and 0, as shown in right part of the rubric table.
(2) (2) If the code passes the compilation, we will execute and test the code using test cases. We will assign points based on the left part of the rubric table.
(3) In both cases (passing compilation and failed compilation), we will read your program and give points based on the points allocated to each sub-question, the readability of your code (organization of the code and comments), logic, inclusion of the required functions, and correctness of the implementations of each function.
(4) Please notice that we will not debug your program to figure out how big or how small the error is. You may lose 50% of your points for a small error such missing a comma or a space!
(5) We will apply the following rubrics to each sub-question listed in the assignment. Assume that points assigned to a sub-question is pts:
Major
Code passed compilation
Code failed compilation
Points
Pts * 100%
Pts * 90%
Pts * 80%
Pts *
60%-70%
Pts * 40%- 50%
Pts * 10%30%
0
Each Subquestion
Meeting all requirements, well
commented,
and working
correctly in all test cases
Working correctly in all test cases.
Comments
not provided to explain what each part of code does.
Working with minor problem, such as not writing comments, code not working in certain
uncommon boundary conditions.
Working in most test cases, but with major problem, such as the code
fail a
common test case
Failed compilation or not working correctly but showing serious effort in addressing the problem.
Failed compilation, showing some effort, but the code does not implement the required work.
No attempt
Please read the FAQ file in the Course Information folder:
Q: For some reason, my assignment submission did not go through, but I thought it went through. I can show you on my local disk or in my Dropbox that I completed the assignment before the due date. Can my assignment be graded?
A: You should always download your own submission from the blackboard after submission and test if the submission contains all the required files. We will grade the assignment submitted to Canvas only. We cannot grade the assignment sent from email or stored in any other places, regardless its last-modified-time. If you submitted your assignment into the blackboard, it cannot be downloaded from the instructor side, but it can download from your side, we can download from your blackboard and grade the assignment. Please meet the instructor or TA in this case.