Find Jobs
Hire Freelancers

Application of structured record type in an array

$30-250 SGD

已完成
已发布大约 8 年前

$30-250 SGD

货到付款
Need the following question answered: HOO Condominium has 3 BBQ pits available for booking by its residents. You are tasked to design and develop a program to allow the user to book a pit given a reservation date. If there is no available pit on the given reservation date, the user is prompt to re-enter the date or enter “E” to exit the system. You are required to use the following given data structures and variables for the program. struct BBQ { int BBQNumber; // Pit Number string cal_date; // calendar date bool available; // status of pit - true if available for booking }; struct Details { string ID; // Booking ID string name; // Name of resident string addr; // Address of resident string rdate; // Reservation date of pit double fees; // $$ charged for the pit }; struct Booking { Details booking_details; BBQ pit; }; const int SIZE = 3; Booking b; // Booking of pit BBQ pits[365][SIZE]; //2-D array that store the pits information for the year (a) Develop the function, initialize() that initializes the values for 2-D array, pits. The function prototype is void initialize(). You may use your own arbitrary values. (4 marks) (b) Design and develop a function, findBBQ() to find the available BBQ pit for booking. The function prototype is BBQ findBBQ(string). The function searches the 2-D array, pits to look up for the available pit with the given reservation date which is pass in as a string variable. It returns the structure record of type BBQ to the calling function. If there is no available pit, set the BBQNumber to 0. (7 marks) (c) Design and develop a function, bookBBQ () to book the pit when one is available for booking. The function prototype is void bookBBQ(Details, BBQ). The function sets the respective values of the structure record, Booking b to the pass-in arguments value. (4 marks) (d) Demonstrate your ability to test the code by developing a test driver to call the functions written in Part (a) to (c). The test driver performs at least the following: (i) Invoke the function, initialize() to store the values of pits. (ii) Uses a loop to prompt the user to enter the reservation date. If the user enters “E”, the loop terminates, otherwise it invokes the function, findBBQ(). If the returned BBQNumber is 0, it means there is no available BBQ pit on the selected date. Display the message, “No available BBQ pit on selected date, please re-enter another date or 'E' to exit.” If there is a pit available for booking, prompt the user to enter ID, name, address and fees and invoke the function, bookBBQ() to book the pit, setting the booking_details and pit of booking, including setting the data field, available to false. (iii) Display the details of the booking. Comment your codes. Refer to the sample output screen.
项目 ID: 9813390

关于此项目

9提案
远程项目
活跃8 年前

想赚点钱吗?

在Freelancer上竞价的好处

设定您的预算和时间范围
为您的工作获得报酬
简要概述您的提案
免费注册和竞标工作
颁发给:
用户头像
Hello, my name is Kostas and I am an expert c/c++ developer with an extensive knowledge of algorithms and data structures. All of my clients were very satisfied with my work which you can verify through my profile here! Please send me a message to discuss the details. Thank you in advance, Kostas.
$80 SGD 在2天之内
5.0 (5条评论)
2.4
2.4
9威客以平均价$123 SGD来参与此工作竞价
用户头像
Hi, I can help you for this job. Please contact me to give more details about this project. I can start right now. Thank you.
$250 SGD 在3天之内
5.0 (4条评论)
4.2
4.2
用户头像
Hi, I am Software Engineer. I have skills in Desktop Application Development, Android Development and Databases. I have experience with C/C++, C#, Java, Visual Basic, SQL/MySQL, HTML/CSS and Javascript. I can do your required work. Regards, Naveed Ahmed
$100 SGD 在3天之内
5.0 (12条评论)
3.6
3.6
用户头像
Hi! Im an electrical and electronic masters student studying in UWE. I have the experience of coding in C/C++/Assembly/Arduino/PIC C/MikroC/MATLAB for more than three years. I also have the knowledge and experience of ELECTRICAL AND ELECTRONICS circuit analysis and design. I also have experience in embedded systems using microcontrollers like PIC, ATMEL, ARDUINO and most of the other types. I have done BCS (British computer society) diploma level. I have the knowledge on PHP/HTML5/mySQL for website development. I have completed many freelancer assignments successfully. If you are interested in hiring me, please send me a message. I have made a lot of reports in the recent past. I have good experience in using Microsoft office softwares like Word, Excel and Powerpoint. I can write reports of any length without mistakes. Thank you!
$36 SGD 在3天之内
4.9 (5条评论)
2.8
2.8
用户头像
I can get you the solution to this easy problem in maximum 24 hrs. I aware about C++ structures. Just approve the bid. hope to get a positive response from you.
$155 SGD 在3天之内
0.0 (0条评论)
0.0
0.0
用户头像
hello i have a vast experience of c++ programming . I am setting a a low bit since i am new to freelancer , i can assure you that i will provide you with THE best code with proper object oriented concepts . Looking foward for your reply
$77 SGD 在3天之内
0.0 (0条评论)
0.0
0.0
用户头像
HI sir i have an idea about this and i am good in c++.kindly assign me this project i can give you on time and also give you the good product. THANKS IN ADVANCE . . .
$155 SGD 在3天之内
0.0 (0条评论)
0.0
0.0

关于客户

SINGAPORE的国旗
Singapore, Singapore
5.0
1
付款方式已验证
会员自3月 1, 2016起

客户认证

谢谢!我们已通过电子邮件向您发送了索取免费积分的链接。
发送电子邮件时出现问题。请再试一次。
已注册用户 发布工作总数
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
加载预览
授予地理位置权限。
您的登录会话已过期而且您已经登出,请再次登录。