List out the operation performed on HDD
In: Computer Science
List and describe the 8 leadership styles
In: Operations Management
(Linked Lists)
The Problem
UCF is growing so large that they’re actually starting a mini-supermarket, KnightsMart, stocked with typical supermarket products along with all the studying essentials (selection of coffees and creamers, pallets upon pallets of Red Bull, and all the Twinkies you can imagine!).
KnightsMart is in need of a program that:
Throughout any given day, the following things can occur (just as in a normal store):
For this program, you will need to maintain three linked lists: a linked list of all products in the store, a linked list of products that need to be reordered, and a linked list of sales that occur on any given day.
You will read in a list of commands from an input file, and your program will execute those commands accordingly. The final command, for each day, will be one that prints out a summary for all sales in the given day, which is detailed in the input/output specifications.
Implementation
You will need to make use of the following structures (EXACTLY as shown):
typedef struct KnightsMartProduct {
int itemNum; char itemName[21]; double unitPrice; int stockQty; int restockQty;
struct KnightsMartProduct *next;
} KMProduct;
typedef struct KnightsMartRestockProduct {
int itemNum;
struct KnightsMartRestockProduct *next;
} KMRestockProduct;
typedef struct KnightsMartSale { char firstName[21];
char lastName[21];
int numItemsOnList; // # of items on shopping list int *itemsPurchased; // array of item numbers
struct KnightsMartSale *next; } KMSale;
You will need to make the following three linked lists:
KMRestockProduct node is made, and it is immediately added to the end of this list.
Input File Specifications
You will read in input from a file, "KnightsMart.in". Have this AUTOMATED. Do not ask the user to enter “KnightsMart.in”. You should read in this automatically. (This will expedite the grading process.). The first line of the file will be an integer, d, representing the number of days that the simulation will run. The first line of each simulation will be an integer, k, indicating the number of commands that will be run for that day’s simulation, with each command occurring on a separate line. Each of those k commands will be followed by relevant data as described below (and this relevant data will be on the same line as the command).
The commands you will have to implement are as follows:
◦ You need to traverse the list using the method shown in class.
◦ For every product (node) in this KMRestockList list, you need to search for that item in the KMproducts list, which will allow you to restock that node accordingly.
◦ Once found, you will increase the stockQty member of that KMProduct based on the restockQty member of that same KMProduct.
◦ You then need to delete that particular product (node) from the KMRestockList. Note: since you delete from the KMRestockList as you traverse the list, this means that you will simply be deleting from the front of the list at all times. ◦ Assuming you follow these steps properly, once you’ve traversed the entire
KMRestockList, restocked all necessary products, and then deleted those products from the KMRestockList, at this point KMRestockList will have no nodes and should point to NULL (meaning, the list is empty).
As mentioned previously, a purchase occurs when a customer finds, and of course then buys, one of the items on their shopping list. When this happens, a KMSale node must be made, which records this sale. The struct members must then be filled in accordingly. One member of the KMSale node is itemsPurchased. This is an array that must be dynamically allocated based on the size (number) on the original shopping list. If the product is found and purchased, the item number is added to the corresponding cell of this array, along with the quantity purchased. We assume that if the stock for a given item is available, the customer will purchase the full desired quantity on their shopping list (of that item). If the product is not found, a zero is recorded in that cell of the array. Based on the three-item example above, if the first and third items were available, with the second being unavailable (no stock), the itemsPurchased array would have SIX cells as follows: 5437, 2, 8126, 0, 9828, 4. This shows that 2 units of 5437 were purchased, and 4 units of 9828 were purchased; the zero after item 8126 simply shows that the item was not available. Finally, once all appropriate information is saved into the struct members of the KMSale node, this node is then added to the end of the KMSales list. Note: a line of output is printed regardless of whether or not a purchase was made. Refer to sample output for examples.
◦ You need to traverse the list using the method shown in class.
◦ For every Sale (node) in the KMSales list, you need to print Sale number (starting at 1), along with the first and last name of the customer (in that order). You then need to print the list of items that were successfully found and then purchased. Finally, you need to print the total amount paid. Please refer to the EXACT output format for specifics.
◦ After printing the appropriate information, you then need to delete that particular Sale (node) from the KMSales list. Note: since you delete from the KMSales list as you traverse the list, this means that you will simply be deleting from the front of the list at all times. This also means that the first Sale (node) in the list will be both the first Sale printed and the first Sale deleted.
◦ Assuming you follow these steps properly, once you’ve traversed the entire KMSales list, printed all necessary information, and then deleted those Sales from the KMSales list, at this point the KMSales list will have no nodes and should point to NULL (meaning, the list is empty).
◦ Lastly, you must print out the total sales (dollar amount) for the given day.
Status of Lists at the end of each day:
At the end of each day, the KMSales list will clearly be empty, as per the description in the PRINTDAYSUMMARY command. This prints each Sale, deletes each node, effectively destroying that list. The other two lists, KMProducts and KMRestockList, will be maintained throughout the entire running of your program. Meaning, you clearly should not destroy (delete all nodes from) the list of products in the store at the end of a day, as this would result in there being no products in the store for subsequent days. Additionally, the
KMRestockList will also be maintained over the simulation. This means that if there were items in the KMRestockList at the end of a given day, those items will remain in that list at the beginning of the next day, thereby allowing them to be restocked whenever a REORDER command arrives.
Output Format
Your program must output to a file, called "KnightsMart.out". You must follow the program specifications exactly. You will lose points for formatting errors and spelling.
When examining the output file, you should notice that the INVENTORY command and the PRINTDAYSUMMARY command results in printing a “semi-formatted” line of text. To avoid guessing games and to guarantee the correctness of your format, we are providing those two print literals below:
Here is the literal for printing inventory items in the INVENTORY command:
"\t| Item %6d | %-20s | $%7.2lf | %4d unit(s) |\n"
And here is the literal for printing customer items in the PRINTDAYSUMMARY command:
"\t\t| Item %6d | %-20s | $%7.2lf (x%4d) |\n"
In: Computer Science
1. List the select prototype medication for the
HMG-CoA reductase inhibitors (statins).
2. Describe myopathy. List the nursing actions and client education regarding myopathy.
3. Heparin is the select prototype medication for
parenteral anticoagulants. List 2 complications of heparin and give
at least 2 nursing actions for each complication.
4. What are the therapeutic uses for the oral
anticoagulant warfarin?
5. What are the therapeutic uses for
Dabigatran?
In: Nursing
7. How can Social Media be used by market researchers? Provide 1 marketing example.
8. List a few wa ys Primary data can be collected.
9. What is the difference between probability and nonprobability sampling?
10. List and briefly define the steps involved in conducting a MR project.
11. List some ways the Internet as facilitated MR. Provide at least “ 1 ” good mar keting example.
In: Finance
In: Operations Management
Q1Explain with your own words the function of a voltage divider and list 3 applications (include the reference/swith your answer)
Q2Explain with your own words the function of a current divider and list 3 applications (include the reference/s with your answer)
Q3Explain the function of dependent or controlled voltage and current sources and list 3 applications (include the reference/s with your answer)
Q4Explain the meaning of Passive Reference Configuration.
In: Electrical Engineering
For Python, I cannot figure out why "and" is printing at the beginning of my list. Can someone help?
listToPrint = []
while True:
newWord = input("Enter a word to add to the list (prest return to stop adding words) > ")
newWord == "":
break
else:
listToPrint.append(newWord)
for item in listToPrint[:-1]:
print(item, end=', ')
print('and', listToPrint[-1])
If I enter m, n, b to the list, it executes to
and m, n, b
In: Computer Science
A. Consider the following relations and relationship:
JobOpening (jobNo, positon, salary, requirement, contactPerson)
NewsPaper(newsPaperNo, name, street, city, zipCode, phoneNo)
Posting(jobNo, newsPaperNo, date, cost)
1. List all the positions that are posted on January 01, 2016
2. List all the positions that have never been posted
3. List the names of all the newspapers where the positions “database administrator has been posted
In: Computer Science
The surface area of a sphere of radius r is S = 4πr2. Its volume is
V = 4πr3/3.
a. Use MuPAD to find the expression for dS/dV.
b. A spherical balloon expands as air is pumped into it. What is the rate of increase in the balloon’s surface area with volume when its volume is 30 in.3?
In: Mechanical Engineering