perfect number is an integer that is equal to the sum of its factors. write down a c++ program that takes an integer x as an input and prints all perfect numbers from 1 to x.
Assume that a grocery shop is introducing shopping through mobile. The shop keeper will gets the list of items from the customer through whatsApp. After receiving the list he will prepare the bill for the customer based on the availability of the items. That is, the shopkeeper will check whether the item is available or not by checking the stock in the shop, if the item is available he will add that item to the bill otherwise he will add that item to another list called not-available list. Finally the shopkeeper will send the bill and the not available list to the customer for confirmation. Write a python code to simulate mobile shopping for a grocery shop to generate bill and not available list. Hint : Create the stock list that contains item, unit price and available quantity.
Consider the transactions:
T1: R1(A), W1(B)
and
T2: R2(A), W2(A), W2(B)
Suppose we insert a pair of lock and unlock commands for each element of the database that the transactions can access.
Assume that a grocery shop is introducing shopping through mobile. The shop keeper will gets the list of items from the customer through whatsApp. After receiving the list he will prepare the bill for the customer based on the availability of the items. That is, the shopkeeper will check whether the item is available or not by checking the stock in the shop, if the item is available he will add that item to the bill otherwise he will add that item to another list called not-available list. Finally the shopkeeper will send the bill and the not available list to the customer for confirmation. Write a python code to simulate mobile shopping for a grocery shop to generate bill and not available list. Hint : Create the stock list that contains item, unit price and available quantity.
Here in this program "aqString" was not defined please check it again
let inputString = '';
let currentLine = 0;
process.stdin.on('data', inputStdin => {
inputString += inputStdin;
});
process.stdin.on('end', _ => {
inputString = inputString.trim().split('\n').map(string => {
return string.trim();
});
main();
});
function readLine() {
return inputString[currentLine++];
}
function main() {
const inputString = readLine();
const subString = readLine();
let index = aqString.find(inputString, subString);
if (isNaN(index) && index <= inputString.length) {
console.log(inputString.split(index));
}
}
You are required to write a program that implements the computerized maintenance of your
monthly expenditure record keeping. You will have to build two classes ExpenseItem,
ExpenseLedger
The class ExpenseLedger will record all the expenses you make. You record an expense by giving
it a serial number, a description (that tells what it is about) and the money you spent on this item. So
you need to create a class ExpenseItem with serial, description and amount. Provide constructors,
getters and setters. Also provide toString for this class. Now in the ExpenseLedger class you need to
build a collection that will hold the instance of ExpenseItem. Provide the following methods in the
ExpenseLedger
1. int removeSmallExpenses(double amt):This method will find expense items that are smaller or equal to amount amt & then remove these items from list. Note that multiple items can be smaller than this value & thus each of these should be removed & return number of items removed.
write a program that implements computerized maintenance of your
monthly expenditure record keeping. You will have to build two classes ExpenseItem, ExpenseLedger
The class ExpenseLedger will record all expenses you make. You record an expense by giving it a serial number, a description (that tells what it is about) & money you spent on this item. So you need to create a class ExpenseItem with serial, description and amount. Provide constructors,
getters & setters & toString for this class. Now in ExpenseLedger class you need to build a collection that will hold instance of ExpenseItem. Provide following methods in
ExpenseLedger
1. void addExpense(description, amount): You should be able to figure out the serial of expense yourself. This method will create an expense item and add it to ledger
Write input, display,
and calculation methods. Your final output should
display all calculated values, including the total
deductions and all defined constants
Write the C code to print the post order traversal of a binary tree from its preorder and inorder traversal.
Given two single linked lists, write a C code to merge their nodes together to make one list, taking nodes alternately between the two lists. So the output with {1, 2, 3} and {7, 13, 1} should yield {1, 7, 2, 13, 3, 1}. If either list runs out, all the nodes should be taken from the other list.