a) Write a linked list classes (one class for Node and another class for List), which stores the items in the transaction. b) Test the classes by printing the items in the linked list c) Show the total price of the transaction. The following listing is the sample output for your reference: No. Items Price 10 3 in 1 Coffee 7.28 Strong Hold Hair Gel Cream Crackers 11 6.49 12 4.19 Extra Strong Hair Spray Royal Hawaiian Nut Pumpkin Seeds 13 16.99 14 3.49 15 5.24 Total (VAT/GST Incl.) $ 43.68
Q: Consider the following figure that represents a single linked list along with the code used to…
A: Below is a linked list where the front node is pointed by Head pointer and last node is pointed by…
Q: 2) Consider a class for a node of a doubly linked list: class node{ String name; String city; node…
A: class node{ String name; String city; node llink, rlink; node(String name , String city){…
Q: Write a generic class that stores two elements of the same type and can tell the user which one is…
A: Programs: The programs contain certain lines of code, that is the instructions given to the computer…
Q: a) Write a Java method that prints 1st, 3rd, 5th, etc. nodes in the double linked list. b)…
A: I am writing the code in java
Q: For this question, people standing in a queue are represented in the form of a struct. Hence, you…
A: //include the required header files #include<iostream> #include<string> #include…
Q: Consider the LinkedList in the given figure. Assume that the nodes are objects of the ListNode class…
A: ptr1 is initially pointing to the node which is having 32 23 is next to 32 and node 23 is same as…
Q: - Write a Java program, using Single Linked List, that allows the user: (Example a linked list as…
A: Since there are multiple sub-questions, we are allowed to answer just 3, kindly repost the question…
Q: Write a C++ program to implement movie rent store, using Linked List, which will allow the store…
A: using Linked List, which will allow the store owner to perform the following functions:a) Insert the…
Q: A LinkNode structure or class which will have two attributes - a data attribute and a pointer…
A: 1.LinkNode.java public class LinkNode { private Toy data=null; private LinkNode next;…
Q: 1. Write a linked list classes (one class for Node and another class for List), which store the…
A: Building a Point of Sales (POS) linked list data structure: Class for POSNode: In Point of sales…
Q: 1- Start by writing your choice from the list given above. Part a. Explain the important technical…
A: . Most of the ADTs in this class were implemented using arrays and linked lists. If appropriate…
Q: Writing append and search methods (singly-linked list) Given main.py and a Node class in Node.py,…
A: Search method def search(self,value): temp=self.head pos=1 while(temp):…
Q: by using c++ & datastructure 1- Implement a class template Node that has the following…
A: Code:- #ifndef LINKEDLIST_H #define LINKEDLIST_H #include <iostream> #include "Node.h"…
Q: Consider the following code class Node String name; Node next; public Node(String name) this.name…
A: The following are the correct answers to be filled in the blanks: p1; p2;
Q: 2. Write a java program to create class Student with the following Marks) : States:Id, Name,…
A: The ArrayList is a type of list and it implements the List interface of Java. Unlike an array an…
Q: Use only CardDeck.java to hold deck of cards, and Card.java to represent each card
A: The coding implementation is below implemented:
Q: Im
A: Coded using C++.
Q: Consider the following figure that represents a single linked list along with the code used to…
A: Answer of the given question: choice (b) 0x547D0 is the right answer. The explanation for the right…
Q: Add the following functions and write a program to test these functions in the class linkedListType:…
A: Program Approach Create node. Create list function to print kth element where k when less than the…
Q: n C++, write a point class with x and y coordinates; declare 3 point objects and push them into the…
A: Approach: In the program, first, we create 3 objects of point class that are p1, p2, and p3. Then we…
Q: Please use the starter code below to answer the question in the screenshot. Please make sure to put…
A: Given:
Q: Code Restructuring: Methods for Linked List operations are given. Restructure the codes to improve…
A: In The given code you have asked to recode two methods: (i) write an alternative version of addLast…
Q: Implement a Symbol table class so that each symbol is associated with a numeric value. The two main…
A: The program is written in java. when the user enters a nonexistent symbol, default value 0 will be…
Q: The following is a class definition of a linked list Node: class Node { int info; Node next; }…
A: Primitive data type gets memory in stack area. When values are not assigned to primitive data type,…
Q: Write a java program using for loop. Take 5 user inputs for name and age and push it into a queue.…
A: import java.util.LinkedList;import java.util.Queue;import java.util.Scanner;class Citizen {…
Q: Refer to Chapter12 LList. Adding nodes to or removing nodes from a linked chain requires a special…
A: given program is in JAVA:-
Q: onsider the Person class in Problem 1. Implement the interface PersonPriorityQueueInterface provided…
A: class is a group of objects which have common properties. It is a template or blueprint from which…
Q: Q# In Java, if you see a class name followed by “”, as in List, what does this mean? Group of answer…
A: List<T>: In java, we are using List for making the collection of objects. The idea of…
Q: Write a C++ program that creates and prints a linked list of classes. Base this program on what you…
A: Below is the C++ program: - Explanation: - Defining the header file and the namespace. Defining…
Q: Add the following operation to the class orderedLinkedList: Void mergeLists(orderedLinkedList…
A: #include<iostream>using namespace std; template <typename T>class orderedLinkedList{…
Q: Could you help me the following question? The Node structure is defined as follows (we will use…
A: In Java Data Structures each cell is called a node of a singly-linked list. First node is called…
Q: A singly linked circular list is a linked list where the last node in the list points to the first…
A: Summary: In this question, we need to implement the given scenario using a circular linked list.
Q: 4. Top Ten Gamers Implement a class that maintains a list of the top 10 performers in a video game.…
A: Given: Please show an example of how or how to solve coding the problem from Starting out with Java…
Q: 1. Write a linked list classes (one class for Node and another class for List), which store the…
A: Building a Point of Sales (POS) linked list data structure: Class for POSNode: In Point of sales…
Q: Given the following definition of a single linked list, write a method that calculates and returns…
A: Code: // Java program to implement // a Singly Linked List public class LinkedList { Node…
Q: Please help with the follow question in C++
A: Program Instructions:Create a function insertOnTheTop() that makes a new node and assign that node…
Q: Write a method for concatenating two singly linked lists L1 and L2, into a single list L3 that…
A: Algorithm: Create a method named concatenateSingleLists() Create a new singly list L3 Concatenate…
Q: 1. Write a java program that reads ten characters into a linked list and displays them in the…
A: // Sorry, but please post one question at a time. If you want the solution to each question, please…
Q: Create a class OrderedLinkedList to implement a singly linked list that stores integer data in the…
A: Answer: our guideline is answer the first three question form the first question. I have written C++…
Q: java program java method: Write a method replace to be included in the class KWLinkedList (for…
A: The ask is to write a method replace for the doubly-linked list, searcing for the element and…
Q: I want convert the code from singly-linked list to doubly-linked list
A: In Doubly Linked List, node has three parts one to store to data, one to store reference of next…
Q: Consider the following implementation of double linked list class. public class DLIST { static class…
A: Remember- If you directly copying this ,please give the necessary indentation if required!!!…
Q: 6.2 Create a Product class with Product Id & Product Name. Write a program to accept information of…
A: Code: import java.util.HashSet;import java.util.Iterator;import java.util.Scanner; class Product{…
Q: Programming Exercise 8 asks you to redefine the class to implement the nodes of a linked list so…
A: Programming Exercise 8 asks you to redefine the class to implement the nodes of a linked list so…
Q: I want convert the code from singly-linked list to doubly-linked list package Problem;…
A: The objective is to convert the given code from singly-linked list to doubly-linked list.
Q: Given a ListItem class, complete main() using the built-in LinkedList type to create a linked list…
A: Please find the answer below
Q: 4. Write a class Polynomial that stores a polynomial such as 5. p(x) = 5x10 + 9x7 – x – 10 as a…
A: code: //Poly_nomial.java import java.util.Iterator; import java.util.LinkedList; import…
Q: do the changes in this program according to the given instruction like coaches instead of…
A: import java.util.*;class Main{ static int max_Students;…
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 1 images
- dont dont psot copied one sure and strict doownvote sure sure dislikeTo reduce traffic congestion in downtown Winburg, Indiana, the mayor convinces the city toset up a public transportation system. Bus-only lanes are to be established, and commuterswill be encouraged to “park and ride”; that is, to park their cars in suburban parking lots andthen take buses from there to work and back at cost of one dollar per ride. Each bus is tohave a fare machine that accepts only one dollar bills. Passengers insert a bill into the slotsas they enter the bus. Sensors inside the fare machine scan the bill, and the software in themachine uses an image recognition algorithm to decide whether the passenger has indeedinserted a valid dollar bill into the slot. It is important that the fare machine be accuratebecause, once the news gets out that any piece of paper will do the trick, fare income willplummet to effectively zero. Conversely, if the machine regularly rejects valid dollar bills,passengers will be reluctant to use the buses. In addition, the fare machine must be…Need help with code completion in python below.: class cross_entropy: def __init__(self): self.X = None self.Y = None def forward(self,X,Y): m = Y.shape[1] logprobs = np.multiply(np.log(X), Y) + np.multiply((1 - Y), np.log(1 - X)) cost = - np.sum(logprobs) / m cost = np.squeeze(cost) self.X = X self.Y = Y return cost def backward(self): m = self.Y.shape[1] diff = self.X-self.Y diff = np.divide(diff,np.multiply(self.X,(1-self.X)))/m self.X = None self.Y = None return diff class mse: def __init__(self): self.X = None self.Y = None def forward(self,X,Y): # YOUR CODE HERE return cost def backward(self): #YOUR CODE HERE return diff
- Santa Claus is working to upgrade his list from a handwritten one to a more modern, digital solution. As youlikely already know, he must keep track of each child, their naughty/nice status, their location, position on hisroute, the toys they asked for, the elves assigned to make those toys, the elves’ working schdule, their favoritepayment methods, and keep track of their production as the year progresses, to make sure nobody will be leftout this Christmas. Keep in mind, he also needs a way to check his list twice. The following bulleted listreiterates what we’ve already discussed as requirements.• Children, their naughty/nice status (two of these for checking the list twice), location, route position (i.e.what order their presents are delivered in), requested toys.• List of elves, production assignments (which toys for which children), preferred payment methods (candy,candy-canes, candy corn, syrup), their work schdedules (assume 3, 8 hour shifts).• List of presents, whether or not…The Miramar Company is going to introduce one of three new products: a widget, a hummer, or a nimnot. The market conditions (favorable, stable, or unfavorable) will determine the profit or loss the company realizes, as shown in the following payoff table: Market Conditions Favorable Stable Unfavorable Product 2 7 W1 Widget $120.000 $70,000 $ 30,000 Hummer $60,000 $40,000 $20,000 Nimnot $35,000 $30,000 $30,000 Using EMV and EOL approach, which product they should introduce? Also calculate Expected Value of Perfect Information (EVPI).Computer Ethics class TOPIC IS "Photos of an NSA “upgrade” factory show Cisco router getting implant" Link for the above article: (Photos of an NSA “upgrade” factory show Cisco router getting implant | Ars Technica) 1. Explain why this topic is important. 2. Who is the Moral Agent in your Scenario 3. What things of value are at Stake? 4. Who are the Stakeholders 5. What are the possible Courses of Action? Must List at Least two (2) 6. What are the consequences of those actions (from #4) 7. Apply Kantianism to your scenario 8. Apply ACT Utilitarianism to your scenario 9. Apply RULE Utilitarianism to your scenario 10. Apply Social Contract Theory to your scenario 11. Apply Virtue Theory to your scenario 12. Identify at least 3 Clauses in the ACM Code of Ethics, give the number, title, and how/why it applies. 13. Identify at least 3 Clauses in the SEI Code of Ethics, give the number, title, and how/why it applies. 14. Concrete Action you would recommend as stated in #5 based on your…
- Need this answer today till 6:45 pmsubject: Artificial IntelligenceQ: write down pros and cons of keeping grid size SxS.Player Team W L ERA SO/IP HR/IP R/IP Verlander, J DET 24 5 2.40 1.00 0.10 0.29 Beckett, J BOS 13 7 2.88 0.91 0.11 0.33 Wilson, C TEX 16 7 2.93 0.92 0.07 0.39 Sabathia, C NYY 19 8 2.99 0.96 0.06 0.37 Haren, D LAA 16 10 3.17 0.81 0.07 0.37 McCarthy, B OAK 9 9 3.31 0.71 0.05 0.42 Santana, E LAA 11 12 3.37 0.78 0.10 0.41 Lester, J BOS 15 9 3.46 0.94 0.10 0.39 Hernandez, F SEA 14 14 3.47 0.95 0.07 0.41 Buehrle, M CWS 13 9 3.58 0.52 0.09 0.44 Pineda, M SEA 9 10 3.74 1.00 0.10 0.43 Colon, B NYY 8 10 4.00 0.81 0.12 0.52 Tomlin, J CLE 12 7 4.25 0.54 0.14 0.47 Pavano, C MIN 9 13 4.29 0.46 0.10 0.54 Danks, J CWS 8 12 4.33 0.79 0.11 0.51 Guthrie, J BAL 9 17 4.32 0.62 0.12 0.54 Lewis, C TEX 14 10 4.39 0.83 0.16 0.51 Scherzer, M DET 15 9 4.42 0.89 0.14 0.52 Davis, W TB 11 10 4.44 0.57 0.13 0.51 Porcello, R DET 14 9 4.75 0.56 0.09 0.57 Major League Baseball (MLB) consists of teams that play in the American League and the National League. MLB collects a wide…Player Team W L ERA SO/IP HR/IP R/IP Verlander, J DET 24 5 2.40 1.00 0.10 0.29 Beckett, J BOS 13 7 2.88 0.91 0.11 0.33 Wilson, C TEX 16 7 2.93 0.92 0.07 0.39 Sabathia, C NYY 19 8 2.99 0.96 0.06 0.37 Haren, D LAA 16 10 3.17 0.81 0.07 0.37 McCarthy, B OAK 9 9 3.31 0.71 0.05 0.42 Santana, E LAA 11 12 3.37 0.78 0.10 0.41 Lester, J BOS 15 9 3.46 0.94 0.10 0.39 Hernandez, F SEA 14 14 3.47 0.95 0.07 0.41 Buehrle, M CWS 13 9 3.58 0.52 0.09 0.44 Pineda, M SEA 9 10 3.74 1.00 0.10 0.43 Colon, B NYY 8 10 4.00 0.81 0.12 0.52 Tomlin, J CLE 12 7 4.25 0.54 0.14 0.47 Pavano, C MIN 9 13 4.29 0.46 0.10 0.54 Danks, J CWS 8 12 4.33 0.79 0.11 0.51 Guthrie, J BAL 9 17 4.32 0.62 0.12 0.54 Lewis, C TEX 14 10 4.39 0.83 0.16 0.51 Scherzer, M DET 15 9 4.42 0.89 0.14 0.52 Davis, W TB 11 10 4.44 0.57 0.13 0.51 Porcello, R DET 14 9 4.75 0.56 0.09 0.57 Due to a recent change by Microsoft you will need to open the XLMiner Analysis ToolPak add-in manually from the home ribbon.…
- Please answer this Python in the simplest way. A1input.txt B001,book,Patriot Games, 15.95B002,book,Origin, 19.95C001,cloth,Armani Suit, 800.00B003,book,Animal Farm, 9.97B004,book,Grant, 22.50E001,elect,EyePhone 10,795.00E002,elect,First Alert Smoke Alarm, 29.95F001,food,Moose Drool Ale 6-pack, 9.95C002,cloth,Pants, 39.95B005,book,Prairie Fires, 18.95E003,elect,Sony Prtable Radio, 15.00C003,cloth,Vasque Hiking Boots, 109.00C004,cloth,Wool Hat, 14.00F002,food,Jumbo shrimp, 12.50E004,elect,HP Laptop, 350.00C005,cloth,Wrangler Jeans, 24.50B005,book,Ragtime, 17.25F003,food,Fusili - 16 oz., 2.95C006,cloth,Nike T-shirt, 19.00C007,cloth,Gore-Tex Gloves, 39.00C008,cloth,North Face Fleece Jacket, 89.95C009,cloth,Nationals Logo Sweatshirt, 49.00E005,elect,LinkSys Router, 49.95F004,food,Lamb Chops, 21.95C010,cloth,New Balance Trail Runners,69.95E006,elect,Altec Lansing Speakers, 195.95B006,book,Future Shock, 8.95E007,elect,LG 55 UDTV,350.00E008,elect,Dell All-in-One PC, 495.00E009,elect,Brother…Hepatitis B is an infection of your liver, where it spreads when people come in contact with the blood,open sores, or body fluids of someone who has the hepatitis B virus. Over the years, vaccines havegenerated some controversy over safety, but no convincing evidence of harm has been found. Despitethe fact that children can have a reaction to any vaccine, the important thing to know is that thebenefits of vaccinations far outweigh the possible side effects.Even though the Screening and Immunisation Team in South Africa operate a failsafe system toensure that children born to hepatitis B positive mothers are appropriately vaccinated in a timelyfashion to reduce the risk of them contracting chronic hepatitis B, there are occurrences when a motheris not informed of their child’s next scheduled vaccination.They have approached you as a project manager to develop a mobile app for this purpose. The teamnoted that the app must track routine immunisation, which would be useful for parents.…Q3: Interplanetary Spaceflight Milan Tusk is the richest person in the universe. After devoting decades of his life to further our space exploration technologies, he’s finally ready to retire. Being a space enthusiast, the first thing he wants to do is visit n planets p1, p2, …, pn, in this order. He’s currently on planet p0. Milan knows that the distance between planets pi and pi + 1 (for 0 ≤ i < n) is d[i]light years. His spaceship uses 1 tonne of fossil fuels per light year. He starts with a full tank and can fill up his tank at any of the n planets (but he must not run out in between two planets). There’s a huge cost to set up the spaceship for refuelling. Due to financial constraints (he’s not THAT rich), he can fill up his tank at most ktimes. In order to save money and make his spaceship lighter, Milan is looking for the smallest possible fuel tank that enables him to complete his space travel and reach planet pn. What is the smallest tank capacity that enables him to do so?…