Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Assignment 6: A Practical Application of C Submit Assignment Due Friday, December 7, 2018 by 11:59pm ET Points 350 Submitting a file upload More than

Assignment 6: A Practical Application of C

Submit Assignment

Due Friday, December 7, 2018 by 11:59pm ET

Points 350

Submitting a file upload

More than half of this assignment is not the actual code you will write, so the amount of code you will end up writing should be manageable in the time that we have remaining.

Part 1: Why learn and use C? (25 points)

To start off this assignment, please look into the history of C, the influence it has had on other languages, and some examples of what the language is used for today and then answer the question "Why learn and use C?". Your answer should be at least 1 paragraph.

There is no "correct" answer to this question. I think that it is an important question to reflect on though when learning any new programming language so that is why I have included it as part of this assignment.

Part 2: Defining the Problem and your Approach Towards Finding a Solution (75 points)

The following is very much a real-world example (though scaled down so that it will be possible for you to complete the assignment in the time that is left in this semester) of a problem that you could solve using C.

The Problem

Given a small database of person accounts, determine which set of accounts in that database are authorized to access a resource and should therefore be sent to the appropriate destination "system" based on the roles associated with those accounts.

The database will contain person records, roles, resources (and by resource I mean a system, service or tool that requires a person to have a specific role in order to access it), a mapping of the roles to people, and a mapping of the roles to resources. This should be all of the information that you need in order to programmatically make the determination about which accounts are authorized.

Each destination "system" that I mentioned can just be a location in local memory (again, for the sake of keeping the scale manageable). When writing to these locations, you will need to allocate memory, write to it, and have a way to maintain it. You should not need these specific implementation details to to come up with a preliminary solution design though.

Designing a Solution

For this part of the assignment, you should not be programming anything. Instead, you should make sure that you understand the functional details of this assignment.

It should also be an opportunity for you to examine your approach to problem solving. The number one reason that I've seen students (and even professionals) fail to complete an assignment or task is because they did not understand what the problem was asking and the steps they needed to take in order to solve the problem. If you take the time to document and think about your design and approach, I do not think that you will find yourself in a place where you are unable to complete this assignment.

For this part of the assignment, how you present your design is up to you. A couple of options are to create a process flow diagram or to create a specification document of some kind, such as a scaled down version of a software requirements specification (SRS) document (some things that normally go into an SRS document, just aren't applicable or aren't worth spending too much time on because of the limited scale of this assignment.

Below, I've included a few pieces of documentation that I've done as part of my current role in Identity Management in case having

Part 3: Writing Pseudo-code (75 points)

Once you have your preliminary design, you should then start to think about specifics of your implementation. Rather than jumping right in and writing C code though, you should first take the intermediate step of writing pseudo-code. I will expect you to turn this in.

When you move on from part 3 to part 4, do not worry about going back and updating your pseudo-code if you find that you've deviated from it in your actual code. The pseudo-code is just a stepping stone to help you write the actual code, so I don't think it is necessary or useful to update it once it is done unless you find that you need to do a massive overhaul of your code and once again use the pseudo-code as your stepping stone.

Part 4: Implementing the Solution (100 points)

Note: I strongly recommend that you do these parts in order (at least parts 2 through 4&5, which can be done concurrently since you should be testing as you go along).

Requirements and a description of how to earn bonus points are specified as a block comment in main.c. Please read this in its entirety.

As far as the source code and database files that I have provided go, change anything that you want to change.

There are several ways to achieve the end goal of the assignment. Two approaches you might take are described briefly below.

Note that this does not mean that you are limited to only these two approaches, but if you are doing anything other than what I have described below, I recommend that you check in with me about it if you are at all unsure about whether your approach will satisfy the requirements of the assignment.

Two Options for Implementing your Solution

Use the getValue function that was provided to you (either as is or by modifying it however you need/want to).

Please note that the code that I have included is actually not the "best" way of doing it.

I chose to do it the way that I did though because it illustrates concepts that you will need to understand in order to do well next semester in the OS course (e.g. working with C-strings and using the functions in the string.h library, passing pointers and pointers to pointers as function parameters and return values, dynamically allocating memory for pointer and pointers to pointers, etc.).

Additional details about this approach are documented in main.c as I previously noted.

Install sqlite3 and utilize its C library, sqlite3.h, to query the data that you need. You can choose other light-weight databases other than sqlite3 as well if you would like.

When I originally wrote this assignment, I intended to require the use of sqlite3. I'm sure though that at least a few of you have not yet had any experience writing SQL queries, so this would have been something additional that you would have to learn. This is outside the course's requirements, so I decided against requiring it.

For those of you already familiar with SQL though or who have the bandwidth to learn the basics and would like to take this approach, feel free to install sqlite3 and query the included sqlite3 database.

This sqlite3 database should contain the same or similar tables that are included as flat files. If you would like to go down this route but need/want some SQL help, I am happy to help you with this or provide you with create table statements at the very least. See me about this if you are interested.

Part 5: Testing your Solution (25 points)

Again, this is specified in main.c. Essentially, the main function should be all that you need to implement for this part if you follow the instructions given.

Feel free to alter the data in the database tables in any way that you need to for testing. Remember, you can always redownload the original file(s) if you mess anything up while changing something in the database.

Part 6: Demoing your Solution (50 points)

You will be required to attend lab (or arrange to meet with either Jordan or me outside of lab) to demo your submission. Please note that this demo is worth 50 points. It is worth this much because there are many ways to implement a solution to this and so for Jordan and I, the demo is necessary for us to make sure we understand your thought process and intention as we grade your submission.

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

Recommended Textbook for

Beyond Greed And Fear Understanding Behavioral Finance And The Psychology Of Investing

Authors: Hersh Shefrin

1st Edition

0195161211, 978-0195161212

Students also viewed these Databases questions

Question

What are Fringe Benefits ? List out some.

Answered: 1 week ago