comp206 | Assignments 4 and 5 for COMP
kandi X-RAY | comp206 Summary
kandi X-RAY | comp206 Summary
Assignments 4 and 5 for COMP 206.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Commit a purchase order
- Substitute strings .
- Initialize the game .
- Render the page
- Reads the inventory from the file .
- Updates the quantity of an item .
- Validate price .
- Validate quantity .
- Handles partial rendering .
- Validate points .
comp206 Key Features
comp206 Examples and Code Snippets
Community Discussions
Trending Discussions on comp206
QUESTION
I've been working on an assignment where we are given a .ssv file that contains bank accounts in the first column and transactions in the second (20 is adding $20 and -20 is taking away $20), and are asked to create a linked list of the accounts using multiple c file.
There are three in question: main.c (opens the ssv and goes line by line), ssv.c (contains a function for parsing out the data from the fgets() string) and linked.c (creates the linked list and updates the account balances by matching the account number and adding the transaction). They are required to remain separate and cannot be made into .h files.
As my code stands currently, nothing it getting put into my linked list header as it would get overwritten every iteration of the while(fgets()) if i just had it write straight to the header. Therefore, I'm looking for some way to have the first line get written to the header and then the loop continues like normal, adding new accounts or updating transactions in current ones. I also noticed that it doesn't seem to be updating the transaction amounts, as it just lists account 10 as having no money. Any input anywhere would be appreciated.
./bank Output:
...ANSWER
Answered 2019-Nov-23 at 06:031) you are initializing your list each time you are trying to update ballance. you should init it only when it points to NULL
QUESTION
I've been working on an assignment where we are given a .ssv file that contains bank accounts in the first column and transactions in the second (20 is adding $20 and -20 is taking away $20), and are asked to create a linked list of the accounts using multiple c file.
There are three in question: main.c (opens the ssv and goes line by line), ssv.c (contains a function for parsing out the data from the fgets() string) and linked.c (creates the linked list and updates the account balances by matching the account number and adding the transaction). They are required to remain separate and cannot be made into .h files.
I've assembled a makefile to put all of them into one executable, but when I run the make, it returns and error. I did some debugging and found that it seems to compile objects files of ssv.c and main.c, but not linked.c, leading to some problems where I use linked.c functions in main.c. I've included each of the file's codes below, as well as the error message that appears when I try to "make". Any help finding the issue would be greatly appreciated.
Error Output:
...ANSWER
Answered 2019-Nov-23 at 00:00You left out the output file in the rule for making the executable file.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install comp206
You can use comp206 like any standard Python library. You will need to make sure that you have a development environment consisting of a Python distribution including header files, a compiler, pip, and git installed. Make sure that your pip, setuptools, and wheel are up to date. When using pip it is generally recommended to install packages in a virtual environment to avoid changes to the system.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page