Find Jobs
Hire Freelancers

struct in C programming

$10-30 USD

완료함
게시됨 약 6년 전

$10-30 USD

제출할때 지불됩니다
/* ******************* File name: trans.h ******************* An online store sells 10 items and allow users to add items to their shopping carts then produce an invoice upon completion of each transaction */ struct StockItem{ int s_id; char s_desc[100]; float s_price; } stock_list[10] = { {111, "50\" LED TV", 1500.00}, {112, "75\" Smart LED TV", 12000.00}, {211, "Home Theater", 250.00}, {221, "3D Sound System", 300.00}, {511, "6\" e-reader", 400.00}, {611, "64GB USB Flash Drive", 50.00}, {612, "128GB USB Flash Drive", 95.00}, {621, "64GB Micro SD Card", 75.00}, {711, "7\" Tablet", 300.00},{611, "10.1\" Tablet", 500.00} }; /* A transaction item stores the item's id and quantity */ typedef struct Item{ int item_id; int quantity; } Item; /* A transaction consists of the name of the customer, number of purchased items and array of purchased items */ struct Transaction{ char customer_name[100]; int items_count; Item* items; }; /* 1- read_item reads an item information from the keyboard and returns it */ Item read_item(); /* 2- new_trans prepares a transaction structure with a customer name cn and an empty list of items, the list should big enough to hold (size) Items, and returns a pointer to the transaction */ struct Transaction* new_trans(char* cn, int size); /* 3- purchase_item adds the item (it) to the transaction (tr). If (tr) contains (it) already, just increase the quantity of the corresponding item, otherwise add (it) as a new item */ void purchase_item(struct Transaction* tr, Item it); /* 4- remove_item removes the item (it) from the transaction (tr) if it exists.*/ void remove_item(struct Transaction* tr, Item it); /* 5- calc_total takes a transaction and returns the total amount that should be paid by the customer for this transaction */ float calc_total(struct Transaction* tr); /* 6- main function does the following: - ask the customer to enter his/her name - ask the customer to enter number of items in his transaction - creates a new transaction with a suitable size - reads the items from the keyboard and add them to the transaction - printf an invoice of the transaction in the form: Mr./Mrs. <Customer Name> Total amount: S.R. <Total Amount> */
프로젝트 ID: 16610975

프로젝트 정보

6 제안서
원격근무 프로젝트
활동 중 6년 전

돈을 좀 벌 생각이십니까?

프리랜서 입찰의 이점

예산 및 기간 설정
작업 결과에 대한 급여 수급
제안의 개요를 자세히 쓰세요
무료로 프로젝트에 신청하고 입찰할 수 있습니다
프로젝트를 수여된 사용자:
사용자 아바타
Hi, I can help you with your assignment in struct. I can finish this in a few hours and guaranteed A+ grade.
$30 USD 0일에
4.9 (16 건의 리뷰)
4.5
4.5
6 이 프로젝트에 프리랜서들의 평균 입찰은 $28 USD입니다.
사용자 아바타
Dear Sir, I have read and understood your project requirements and I'm very interested to work on it. I have experience of programming in C. I have done many programs in C and I write well formatted code with comments. Looking forward to work on your project. Waiting for your positive reply. Thank you
$20 USD 1일에
4.5 (24 건의 리뷰)
4.5
4.5
사용자 아바타
I have a lot of experience in programming (more than 15 years). This looks to be a very easy task, I can provide a small demo version is you like.
$25 USD 1일에
5.0 (9 건의 리뷰)
3.2
3.2

고객에 대한 정보

국기 (SAUDI ARABIA)
Riyadh, Saudi Arabia
5.0
3
1월 3, 2017부터 회원입니다

고객 확인

감사합니다! 무료 크레딧을 신청할 수 있는 링크를 이메일로 보내드렸습니다.
이메일을 보내는 동안 문제가 발생했습니다. 다시 시도해 주세요.
등록 사용자 전체 등록 건수(일자리)
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
미리 보기 화면을 준비 중...
위치 정보 관련 접근권이 허용되었습니다.
고객님의 로그인 세션이 만료되어, 자동으로 로그아웃 처리가 되었습니다. 다시 로그인하여 주십시오.