A. A single linked list provides pointers to the next node in the sequence.
Consider the below structure of the linked list and answer the questions that follow:
Assuming the front is the 1st node and the back is the Nth node, state and explain the running times for the below:
i. Find a node from the front. [2 marks]
ii. Find a node from the back. [2 marks]
iii. Insert a node at the front. [2 marks]
iv. Insert a node at the back. [2 marks]
v. Erase a node from the front. [2 marks]
vi. Erase a node from the back. [2 marks]
Given two boolean values
isGrassTrimmerFound and isWaterHosePipeFound as inputs, create three JS promises using async/await and try/catch blocks.
Input
The first line of input contains a boolean isGrassTrimmerFound
The second line of input contains a boolean isWaterHosePipeFound
Sample Input 1
true
true
Sample Output 1
Grass Trimmed
Garden Cleaned
Watered Plants
Sample Input 2
true
false
Sample Output 2
Grass Trimmed
Garden Cleaned
Water Hose Pipe Not Found
"use strict";
/* Please do not modify anything above this line */
function main() {
const isGrassTrimmerFound = JSON.parse(readLine());
const isWaterHosePipeFound = JSON.parse(readLine());
/* Write code */
const myPromise = async () => {
try {
/* Write code */
} catch(error) {
/* Write code */
}
};
myPromise();
}
Online Cake Ordering System: 1) Add a new order 2) Retrieve an order 3) Deliver an order 4) Print summary report 5) Exit system
Add a new order
Retrieve an order
The system shall retrieve and remove the order (with the nearest delivery data and time) from the binary heap data structure and update the status as “in progress” and move the order into a queue data structure.
Deliver an order
The user will retrieve a work in progress order from queue based on first in first out (FIFO) concept and move the order to a stack. Status of the order will be updated as “delivered”.
View summary report
Note: No built-in classes of the data structure (heap, queue and stack) are allowed.
Given polynomial, write a program that prints polynomial in Cix^Pi + Ci-1x^Pi-1 + .... + C1x + C0 format.
a class Customer: Private Members :Customer_no , Customer_name , OrderQty, Price, TotalPrice, Discount, Netprice . Member Functions are:
Public members: A constructer to assign initial values of Customer no , Customer name as , Order Quantity as (0) and Price, Discount, Netprice as (0.0) respectively. A Function Input( ) – to read data members (Customer_no, Customer_name, Quantity and Price) and call calDiscount() function. A function Show( ) –to display Customer details with values for all data members. Protected members: A function calDiscount( ) - to calculate Discount according to TotalPrice and to calculate value of NetPrice.
TotalPrice>=50000
Discount 25% of TotalPrice
TotalPrice>=25000 and TotalPrice<50000
Discount 15% of TotalPrice
TotalPrice<250000
Discount 10% of TotalPrice
Write a program for customer class and enter data for two customers one using constructor and other using input function display value of all data members for both objects.
CONTINUATION..
For example, for the string "aaa", the output should be the following.
aaa is missing letters bcdefghijklmnopqrstuvwxyz
If the string has all the letters in alphabet, the output should say it uses all the letters. For example, the output for the string alphabet itself would be the following.
abcdefghijklmnopqrstuvwxyz uses all the letters
Print a line like one of the above for each of the strings in test_miss.
Submit your Python program. It should include the following.
Write a function called missing_letters that takes a string parameter and returns a new string with all the letters of the alphabet that are not in the argument string. The letters in the returned string should be in alphabetical order.
Your implementation should use a histogram from the histogram function. It should also use the global variable alphabet. It should use this global variable directly, not through an argument or a local copy. It should loop over the letters in alphabet to determine which are missing from the input parameter.
The function missing_letters should combine the list of missing letters into a string and return that string.
Write a loop over the strings in list test_miss and call missing_letters with each string. Print a line for each string listing the missing letters.
QUESTION NOT COMPLETE BUT TO BE CONTINUED...
For this assignment, you are required to understand the Problem Frames and then model the following requirements using problem frames:
For an e-commerce store, an item is added to the shopping cart, as soon as, the "Add-to-Cart" button is pressed, however, whether the item can be processed for payment, will depend on whether the item is in inventory or not, when the customer is trying to make the payment. If the item is not in inventory, when the customer is trying to pay for it, then the customer should be informed, and the item is removed from the customer's cart.
Write a function n called is_descending that takes a list of numbers and returs True if the elements are in descending order and False if not. It should just check the users input if its in descending order and returns true if it is and if not false
Create a class called Time that has separate int member data for hours, minutes,
and seconds. One constructor should initialize this data to 0 (default constructor),
and another should initialize it to fixed values (overloaded constructor). Another
member function should display it, in hh:mm:ss (hours: minutes: seconds) format.
Also write the destructor of this class. Write the program that creates three
objects (t1, t2 and t3) of the class to display the time. Initialize t1 using default
constructor, t2 with overloaded constructor and t3 with the values of t2