1. Listed next is the skeleton for a class named InventoryItem. Each inventory item has a name and a unique ID number: class InventoryItem private String name; private int uniqueItemID; } Flesh out the class with appropriate accessors, constructors, and mutators. The uniqueItemID 's are assigned by your store and can be set from outside the InventoryItem class-your code does not have to ensure that they are unique. Next, modify the class so that it implements the Comparable interface. The compareTo() method should compare the uniqueItemID 'S; e.g., the InventoryItem with item ID 5 is less than the InventoryItem with ID 10. Test your class by creating an array of sample InventoryItem 's and sort them using a sorting method that takes as input an array of type Comparable.
Q: write a for loop equivalent to the stated while loop. int count =23; while (count<100) { system....
A: Java Program of above code using for loop: class Loop{ public static void main(String[] args) { int...
Q: Question 2 ) Listen As a I will work to make the team's work visible to various stakeholders. Select...
A: The product owner is defined as a scrum development role for a person which is responsible for desc...
Q: sing Shannon’s Expansion implement the function F = A′C ′D + BCD′ + ABD′ using only one 4-to-1 MUX (...
A:
Q: Explain how to save simple data types in a session using a PHP script.
A: Introduction Data types in sessions the simple data types that are handled by the sessions are an i...
Q: Question) You are asked to write a MATLAB program for a school for assigning students to exam halls....
A: Step 1 : Start Step 2 : Take input for the Student Name from the user. Step 3 : Take input for the S...
Q: Given the format MM/YYYY write a regular expression that validates the string having date values bet...
A: Given the format MM/YYYY write a regular expression that validates the string having date values bet...
Q: Advantages and disadvantages of Artifical Intelligence in society
A: Artificial Intelligence is a program which has been designed to do work that can be done by the inte...
Q: Consider the following TLB for with 6-bit VPNS and 8-bit PFNS: VPN PFN valid prot 54 184 1wx 42 197 ...
A: Since 8-bit processor has 8 bit address size and size of page number is 6 bit, hence number of bits ...
Q: What is the main advantage of the layered approach to system design? What are the disadvantages of t...
A: Advantages The framework is straightforward and simple to understand and apply. Because each layer's...
Q: 1) Plot F on a k-map and find a minimum AND-OR circuit which implements F. 2) Identify the 1-hazar...
A: Here is the given things are: Given F(A, B, C, D)m(0, 2, 4, 5, 7, 10, 11, 13, 14, 15)
Q: BioLock and BioScan (Provide complete details). Compare these products with other biorecognition acc...
A: Biometric can be defined as the authentication that is used in computer system to provide access and...
Q: t. Write a JAVASCRIPT program to create a random string of lowercase alphabets of length 10 and disp...
A: Write a JAVASCRIPT program to create a random string of lowercase alphabets of length 10 and display...
Q: write code to determine if the first character in an input string str is an uppercase character.if t...
A: - We have to code for the uppercase checking problem. - We are using C++ here.
Q: 6. Write a PHP program to input the 3 side lengths(in cm) of a triangle and print whether the triang...
A: According to the Question below the Solution: Output:
Q: I have my code below and I am stuck at the last part which is the display of the thread that finishe...
A: The Answer is
Q: t and last character being equal and the middle characters are all the same but not equal to the fir...
A: Lets see the solution.
Q: rallel arrays and range matches for this application. 1. Declare variables with proper data types ...
A: c program is an given below :
Q: Three points P, Q, and R are said to be collinear if they are on a single line. To check whether the...
A: Step 1 : Start Step 2 : Take user input of the coordinates for the Three Points (P , Q , R). Step 3 ...
Q: You are a software developer for a large online retailing site with a cloud-based IT infrastructure ...
A: Let's see the solution in the next steps
Q: Which of the following will guide an individual to properly handle substances such as chemical solve...
A: a. OSHA -> OSHA stands for Occupational Safety and Health Administration. This is a law establish...
Q: What are the benefits of multiprocessors?
A: Introduction: The following are some of the advantages of a multiprocessor. 1. Increased Reliability...
Q: Use Common Table Expressions (CTE) to write a query that displays the sum of all purchase orders and...
A: Common Table Expression (CTE) Common Table Expression is nothing but a temporary result set. We can ...
Q: Test Data Objectives • Familiarize with the concept of numbers, operators, and Sample input arithmet...
A: In this question, to solve the algebraic expression by putting different value of x in python code.
Q: What are the prerequisites for becoming a Linux system administrator?
A: Introduction Linux System Administrator: Linux systems administrators oversee the installation and m...
Q: te path that i
A: given - Consider a graph with nodes and directed edges and let an edge from node a to node b be repr...
Q: (1) What do you mean by Binning ? Explain different method of Binning? (11) For the Age data given b...
A: Introduction: Noisy data: Noise is a random error or variance in a measured variable. Data smoothing...
Q: Why are arithmetic expressions in reverse Polish notation represented by stack architectures?
A: Why are arithmetic expressions in reverse Polish notation represented by stack architectures?
Q: Why should we use a linker? Group of answer choices A. The linker can help you find errors in your p...
A: A linker is a program that takes one or more object files generated by a compiler and combines them ...
Q: 5.8 The do-while Statement and H FIGURE 5.14 Validating Input Using do-while Statement 1. /* Returns...
A: Explanation: The user is invited to enter the number that is printed in the specific range that is ...
Q: follow instruc
A: logic:- Set sum=0 iterate from i=0 to i<length of array sum=sum+arr[i] end loop display length...
Q: In x86-64 assembly, how many registers do we have, and can we use registers like %rsp for anything w...
A: Some registers are designated for a certain purpose, such as %rsp being used as the stack pointer or...
Q: Design a Turing Machine that accepts all binary words in the form of a∗b∗a∗.
A:
Q: 6. Write a function EXPCR( ) which accepts a 3 × 1 vector x = the 3 x 3 rotation matrix which repres...
A: Hi Dear!! Please like...It is more valuable 6) To define multiplication between a matrixAA and a...
Q: For this question you are going to provide code fragments that implement two methods. You do not nee...
A: Doubly Linked List: A doubly linked list is different from a singly linked list in a way that each n...
Q: mentation of a Doubly vLinkedList without us ints to +he lost node (s
A: package ll4;class Node{ Node prev; int info; Node next; Node(Node prev,int info,Node next){ this.pr...
Q: Write an application that will take - 5 digit integer from user and calculate the sum of all digits ...
A: Program Explanation:- Using the header file. Using the namespace standard input/output function. De...
Q: What is the main advantage of the layered approach to system design? What are the disadvantages of t...
A: In the layered approach to system design, different services of the operating system are divided int...
Q: What is a singleton class in Java, and how do we create one?
A: Intro Singleton class: Singleton is nothing but a concept of object-oriented programming language w...
Q: The ColorCube class is a subclass of Shape3D and can be used as a leaf node to represent a cube with...
A: Java has arguably become the language of networked computing and the Internet. High−level support fo...
Q: Describe the role of forensic investigator in instigating the computer forensics for an organization
A: Following are the roles of forensic investigator: 1) The forensic investigator retrieves data from ...
Q: ccurs in a at a position which is greater than or equal to start, and less than end. You must valida...
A: Code: import java.util.*;class ContainsInRange{ public static boolean validate(int arr[],int x,in...
Q: the three selling items for each of the five artists. The artist names must be stored in a single ar...
A: As not specified I have Solved question in Java language Code: import java.util.Scanner; public clas...
Q: Q9) To store/represent a 3D sphere as model-based computer graphics object in my computer I need a m...
A: Introduction: Parametric Equation of an Ellipse: The parametric formula of an Ellipse - at (0, 0) wi...
Q: Is it possible to call a class function Object() { [native code] } from within another function Obje...
A: Introduction The question is about Is it possible to call a class function Object() { [native code]...
Q: The International Air Transport Association surveys business travelers to develop quality ratings fo...
A: Concepts and reason The confidence interval is defined as the range of values with a specified pro...
Q: What exactly are the different disk-scheduling algorithms?
A: Introduction The question is about What exactly are the different disk-scheduling algorithms and her...
Q: In Java, what is a collection class? Make a list of all of its methods and interfaces.
A: Java collection class consists of static methods that operate on or return collections. It is member...
Q: hat is obtain from G − ε by merging 2 and 3 into a single vertex w. (As in the notes, v is adjacent ...
A: A graph can exist in different forms having the same number of vertices, edges, and also the same ed...
Q: Differentiate the following: String Object from String Class, Substring from IndexOf, Date class fro...
A: String class, object, sub-string and date format are the concepts in JAVA programming language Lets...
Q: Write code to determine if the first character in an input string str is a lowercase character. If t...
A: I have provided JAVA CODE along with CODE SCREENSHOT and also provided OUTPUT SCREENSHOT...
I need some help with this coding problem
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 5 images
- Book Donation App Create a book-app directory. The app can be used to manage book donations and track donors and books. The catalog is implemented using the following classes: 1. The app should have donors-repo.js to maintain the list of donors and allow adding, updating, and deleting donors. The donor object has donorID, firstName, lastName, and email properties. This module should implement the following functions: • getDonor(donorId): returns a donor by id. • addDonor(donor): adds a donor to the list of donors; donorID should be autoassigned a random number. • updateDonor(donor): updates the donor having the matching donorID. • deleteDonor(donorID): delete the donor with donorID from the list of donors, only if they are not associated with any books. 2. The app should have books-repo.js to maintain the list of donated books and allow adding, updating, and deleting books. The book object has bookID, title, authors, and donorID properties. • donorID references the book’s donor. This…Computer Science Write the code to define a class called student. The student class should contain a data attribute called name and another attribute called gpa. Write the Student class to include an initializer method __init__ and a __str__ method. Create two different objects of the student class and call print on each object to display the output in the __str__method.Chapter 15 Customer Employee Creator Create an object-oriented program that allows you to enter data for customers and employees. Each class will be stored in its own python file. Console Specifications Create a Person class that provides attributes for first name, last name, and email address. Include a parameter for each attribute in the constructor method. This class will provide a property or method that returns the person’s full name. Create a Customer class that inherits the Person class. This class must add an attribute for a customer Create an Employee class that inherits the Person class. This class must add an attribute for a social security number (SSN). Put the above three classes in a module named ‘company_objects’, separate from the application module. The program will create a Customer or Employee object from the data entered by the user and store the object in a single variable. Create a function that will display the Customer or Employee. The function will have a…
- Personal Information Class: Design a class called Employee that holds the following data about an employee: name ID number Department Job Title Class. Store your class in a separate file called employee.py. Your class will have an initializer method that will be passed the information entered by the user as arguments. Write appropriate accessor and mutator methods for each data attribute. Write a __str__ method to print the contents of the class (see example of __str__ on p. 523). Main program: Your main program should create three instances of the class. Your program should get the information from the user and pass it as parameters to the initializer method. Using the __str__ method invoked by the print function, the program should display the personal information for the three individuals. Output and Sample Dialog: Enter employee name: Mary Smith Enter employee ID: 123456 Enter department: Accounting Enter position: Accountant Enter employee name: Joe Morales Enter…Double Bubble For this exercise you need to create a Bubble class and construct two instances of the Bubble object. You will then take the two Bubble objects and combine them to create a new, larger combined Bubble object. This will be done using functions that take in these Bubble objects as parameters. The Bubble class contains one data member, radius_, and the corresponding accessor and mutator methods for radius_, GetRadius and SetRadius. Create a member function called CalculateVolume that computes for the volume of a bubble (sphere). Use the value 3.1415 for PI. Your main function has some skeleton code that asks the user for the radius of two bubbles. You will use this to create the two Bubble objects. You will create a CombineBubbles function that receives two references (two Bubble objects) and returns a Bubble object. Combining bubbles simply means creating a new Bubble object whose radius is the sum of the two Bubble objects' radii. Take note that the CombineBubbles function…The main advantage of the encapsulation is that, it provides abstraction between an object and its clients. Select one: O True OFalse Encapsulation is the process of grouping the attributes and method of an object together in a single data structure known as a class Select one: O True O False A constructor is a member variable that is called automatically when an object is created. Select one: O True O False We cannot declare more than one constructor per class. Select one: O True O False on
- User-defined Class:You will design and implement your own data class. The class will store data that has been read asuser input from the keyboard (see Getting Input below), and provide necessary operations. As thedata stored relates to monetary change, the class should be named Change. The class requires atleast 2 instance variables for the name of a person and the coin change amount to be given to thatperson. You may also wish to use 4 instance variables to represent amounts for each of the 4 coindenominations (see Client Class below). There should be no need for more than these instancevariables. However, if you wish to use more instance variables, you must provide legitimatejustification for their usage in the internal and external documentation.Your class will need to have at least a default constructor, and a constructor with two parameters:one parameter being a name and the other a coin amount. Your class should also provide appropriateget and set methods for client usage. Other…User-defined Class: You will design and implement your own data class. The class will store data that has been read as user input from the keyboard (see Getting Input below), and provide necessary operations. As the data stored relates to monetary change, the class should be named MoneyChange. The class requires at least 2 instance variables for the name of a person and the coin change amount to be given to that person. You may also wish to use 6 instance variables to represent amounts for each of the 6 coin denominations (see Client Class below). There should be no need for more than these instance variables. However, if you wish to use more instance variables, you must provide a legitimate justification for their usage in the internal and external documentation.Your class will need to have at least a default constructor, and a constructor with two parameters:one parameter being a name and the other a coin amount. Your class should also provide appropriate get and set methods for…A. Car Class Create a Python Program where you write a class named Car that has the following data attributes: • _ _year_model (for the car's year model) • __make (for the make of the car) • _ _speed (for the car's current speed) The Car class should have an _init_ method that accepts the car's year model and make as arguments. These values should be assigned to the object's _year_model and make data attributes. It should also assign 0 to the __speed data attribute. The class should also have the following methods: accelerate() The accelerate method should add 5 to the speed data attribute each time it is called. brake() The brake method should subtract 5 from the speed data attribute each time it is called. • get_speed() The get_speed method should return the current speed. Next, design a program that creates a Car object then calls the accelerate method five times. After each call to the accelerate method, get the current speed of the car and display it. Then call the brake method…
- Class Student __init__(self, id: int, fist_name: str, last_name: str, town:str): """ This creates a student object with the specified ID first and last name and home town. This constructor should also create data structure for holding the students grades for all of there assignments. Additionally it should create a variable that holds the student's energy level which will be a number between 0 and 1. :param id: The student's identifiaction number :param fist_name: The student's first name :param last_name: The student's last name :param town: The student's home town """ get_id(self)->int: """ Returns the ID of the student as specified in the constructor. :return: The student's ID """ get_first_name(self) -> str: """ Returns the first name of the student. :return: The student's first name """ set_first_name(self, name:str): """ Changes the student first name to the specified value of the name parameter. :param name: The value that the first name of the student will equal. """…In java programming language Design a class named Account that contains:• A private double data field named annualInterestRate that stores the current interest rate.Assume all accounts have the same interest rate (i.e. static member data).• A private int data field named nextAccountNb that stores the next account number to beassigned (default 300). Assume all accounts use this data member to assign the account number while creating an account (i.e. static member data).• A private int data field named accounNb for the account.• A private String data field named f_name for first name.• A private String data field named l_name for last name.• A private double data field named balance for the account.• A private Date data field named dateCreated that stores the date when the account wascreated. (usejava.util.Dateclass)• A constructor that creates an account for a given first name, last name, and initial balance. It sets up a new account number, first name, last name, balance, date of…NewspaperSubscriber class- create an abstract class named NewspaperSubscriber with attributes to contain the subscriber’s street address and the subscription rate. Include get and set methods for both these attributes. The set method for the rate is abstract. The setAddress method must prompt the user to enter the subscriber’s address through the use of a dialog box. Create a constructor for the base class. Create a toString() method that concaternates and returns the subscriber’s street address and rate for display. Create 3 child classes named SevenDaySubscriber, Weekday Subscriber, and Weekend Subscriber. Each child class has an additional attribute called subType, which is a String, that will store the type of newspaper subscription. Create a setType method that will set the type of subscriber as follows: “Seven Day”, “Weekday”, or“Weekend”. Create a setRate method for each child class that sets the rate as follows: a SevenDaysubscriber pays R18.00 per week for his newspapers, a…