Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Hello I need help finding the solution to this problem that needs to be solved in C. THANK YOU! The yellowbox sample code is the
Hello I need help finding the solution to this problem that needs to be solved in C. THANK YOU!
The yellowbox sample code is the following:
Project Description Redbox is a nationwide network of kiosks where customers can rent DVDs, Blu-Ray discs, and video games. For this project, we will implement a program named "YellowBox that emulates a Redbox kiosk (to a very limited degree) using arrays, structures, and file l/O. We have given you a skeleton source code file named "yellowbox.c"; you may use this as a starting point for your project (for example, a fully-working main() function is already provided for you), or re- implement everything on your own Follow the steps below to complete the project assignment. Two sample data files have been provided on Blackboard for you to use while testing your code 1. Start by defining some useful data types and global variables 1. Define a struct to represent a particular movie. A movie struct contains a string that holds the movie's title, and an integer that tracks the number of copies that are currently in stock. For example, a variable of this type might record that the kiosk currently contains 3 copies of "Braveheart" 2. Create a array to hold your movie structures. You may assume that our kiosk will track no more than 50 distinct movie titles 3. Create a global integer variable to track the total number of distinct movie titles that the kiosk knows about (i.e., has seen at some point through a transaction request). This variable's value also indicates the total number of occupied positions in your movie array. Initialize this variable to 0 4. Create a global integer variable to track the total number of discs that are currently held in the kiosk. Initialize this variable to 0 2. Complete the findMovie helper function, which locates a particular movie title in your array int findMovie (char *title) If the kiosk is currently empty, this function returns -1 Otherwise, use a loop to examine each movie structure in your array of movies. If the current movie's title matches the title you are searching for (use the strcmp function compare two strings), return the index of the matching movie structure from your array. you complete the loop without finding a match, return -1 to indicate that the title is not presentStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started