Organising Item storage in the computer can assist in ensuring that the Items that were stored in the
stock item list first are the first to be taken out. This will ensure that older stock is sold first. Conduct
some research on what data structure you can use in the storage of Item in the retail shop instead of
using a list.
2.1 Change the storage List of the Items in the Retail Shop so that the item stored first are the items
removed first when items are sold
1.5 A retail shop have functionality to sell. The sell function must take item name, and size as a
parameter. Removes the item from the stock and put that Item in the sold list. The sell function also
displays the sold item details, name, size, and days before expiry date. [2]
If item is not available in the stock a message must be displayed on the screen “no stock”;
1.6 An Items class need to be created in order to implement a complete Retail Shop. All items MUST/
FORCED to have the getPrice() function returns price of an item , setPrice(double price), returns
nothing, but set a price of an Item. [2]
A Retail has name, a List containing Items available in the stock and another List containing sold
items. [2]
1.2 A Retail have functionality to view available stock, that prints Class name of item, name of Item,
size of item and total number of items that have same name, and size. [5]
EXAMPLE
ClassName Item name Size Total
Drink coke 1 10; // this show that in the list there are 10 coke that are size of 1
Drink coke 2 5; // this show that in the list there are 5 coke that are size 2
Sizes in drinks means litres.
Hint: Items are the same if their class name, item name and size are the same.
1.3. A retail Shop has a functionality to add item into the stock list. The add item takes a parameter
the Item to be added on stock. [2]
1.4 A retail shop also has a functionality to calculate total sales that returns double sum of money
made from all sold items. [2]
Write a function that takes a number and rounds it up to the nearest integer
1. Add code to the HTML file to reference the script.js file using best practices. Other than this, do not modify either the HTML or CSS file. 2. In the script.js file set strict mode for JavaScript. 3. Create a new h3 element with your name in it and insert it before the first paragraph. 4. In the footer, add a cite element with the text "Information and photos from Wikipedia" where "Wikipedia" is a link to the page "https://en.wikipedia.org/wiki/Bumblebee". 5. console.log the number of paragraphs with some descriptive text (open the browser console to see the output). 6. Add the class "special" to the second h2 element. 7. Select all the figcaptions and make the font italic. (This will require a for loop.) 8. Once complete, use Zip to compress the whole folder (including all files) and submit the zip file.
1. computeUnsignedBinary function: This function takes a static array, bit pattern length, and a non-negative integer number as its arguments The function must populate the array with the unsigned binary representation of the non-negative integer number argument in the given bit pattern length. Assume the all the arguments are 2. computeSignAndMagnitudeBinary function :This function takes a static array, bit pattern length, and an integer number as its arguments. The function must populate the array with the sign and magnitude binary representation of the integer number argument in the given bit pattern length Assume the all the arguments are valid The sign bit of a zero integer number must be set to 0 (not 1), see the sample run outputs below.
WAP to create a class Time having members as hours, minutes and seconds . Initialize the object by using parameterized and copy constructor. Write the functions for addition and difference of Time objects.
Maximum Number of Books
There are multiple (T) bookstores in the area.Each shopkeeper has a list of B integers that represents the cost of each book.You have different pocket money(P) for each bookstore.Write a program to calculate the maximum number of books you can buy in each store with the corresponding pocket money.
Explanation
Given P = 600 and B = [120, 140, 110, 180, 120, 110] with a pocket money of 600, we can buy the books at index 0,1,2,4,5 , whose sum is 120+140+110+120+110 is equal to P.
Given P = 300 and B = [120 110 1300 130] with a pocket money of 300, we can buy the books at index 0,1 whose sum is 120 + 110 and is less than P.
Given P = 100 and B = [220 1000 500 2000] with pocket money of 100, we can't buy any book. So the output should be Retry.
Sample Input1
3
6 100
20 40 10 80 20 10
4 70
20 10 300 30
4 200
220 1000 500 2000
Sample Output1
5
3
Sample Input2
2
8 250
2070 1350 365 2750 30 20 140 240
4 500
1070 2893 2200 39
Sample Output2
3
1
Write a program in such a way that if I'm going to enter a random number from 1 to 5, and I get the food item and its price on separate lines (use '\n'). 1. Pizza, Rs 239 2. Burger, Rs 129 3. Pasta, Rs 179 4. French Fries, Rs 99 5. Sandwich, Rs 149 So, in this case if I enter 3, the output should print something like - Food item - Pasta Price - Rs 179