The code is supposed to prompt the user to enter a studentID and if it is in the records then it will be removed, but instead it just prompts me to enter and when i enter the ID, it does not remove the ID (I display the data again after I supposedly removed it but it is still there) and just returns back to the menu. What can I do to correct it?
Q: Find the error in each of the segments. If the error can be corrected, explain how ?…
A: Given: Find the error in each of the segments. If the error can be corrected, explain how ?…
Q: _(self): self.head = None self.tail = None def append(self, new
A: A linked list is a linear and dynamic data structure as they grow or shrink in size during the…
Q: Question1- Add to the Test class a method called isSubSet(LinearProbingHashTable h1,…
A: #include <iostream> #include <cstdio> #include <cstdlib> using namespace std;…
Q: Fix all the errors of the cade for doublehashing question class DoubletoshTable def init_(sel, 13,…
A: To do: Fix the errors in the given code.
Q: An item in a list has another .synonyms, which is index True O False O baython
A: Correct answer :True. Explanation below:
Q: Create an ArrayList , HashMap and HashSet Add 2 elements/entries to ArrayList , HashMap and HashSet…
A: ArrayList: It is one of the classes of the Java Collection framework. As the name suggests It is…
Q: def rent_bike(station_id: int, stations: List["Station"]) -> bool: '""Update the available bike…
A: Program is well commented for better understanding. Code snippet is provided below the typed code.…
Q: In python program some issue find the issue class Node: def __init__(self,data): self.wait = data;…
A: Here, I have to modify the python program to get exact output.
Q: names of classes/variables/objects can be misleading!!!!" import java.util.HashSet;…
A: hi
Q: Objective: This activity has the purpose of helping students to design proper hashing strategies.…
A: Here is the answer with an output:-
Q: Rearrange the following lines of code to print the names of all students who have a score > 10 in…
A: Here is the solution with an output:-
Q: Question #2:- (Display the list records of the distribution class only) After solved the Question…
A: Creating and Using Arrays That creates the array, puts some values in it, and displays the…
Q: Use C++ Programming language. The header file below defines a class for a simple hash table:…
A: Answer : Solution: Note: The code image which you have attach is blury so i am implementing in c++…
Q: Finish the Java code Use the binary and sequential search algorithm to search list import…
A: The below answer is coded in java language.
Q: True or FalseAn application works directly with a database, modifying rows, deleting rows, adding…
A: An application needs a DataSet object for the database. The data can be modified after the DataSet…
Q: public class PasswordGeneratorAndStorage
A: Here is the answer which is mentioned below: When i ran this code, i did not had any problem,…
Q: Evaluate the following expressions a. foldFromLeft(minus, 6, map(RemoveTwo, [3, 4, 8])) b.…
A:
Q: void show_all_item() { system("cls"); cout << endl << "\n\t\t---- cout << endl << "\n\t\t\t\tITEM…
A: Answer:
Q: Write an Add method that adds the contents of the decPrice variable to the lstPrices control.
A: Add method The add method is used to add a specific element. The function is used to add the…
Q: E Template 2 import random 3 4 vclass Card: def init__(self, value, suite): self.value - value 6 7.…
A: Solution :: Python code : ### Template import random class Card: def __init__(self, value,…
Q: indicated by the pointer varlable expressions below, based following linked list: 10 15 25 30 35 45…
A: Here in this question we have given a doubly linked list and we have asked to calculate some…
Q: Which of the following statements are true about a HashSet ? Select all that apply. Hint: you should…
A: Please upvote. I am providing the correct answer below. A is false, Each hash code will map to a…
Q: +_str_ + add_undergrad(name, email, gpa) Student + add_graduate(name, email, level) |- name : string…
A: Brief Introduction: We have to write a code in Python that will make sure that the gcd of numbers…
Q: Q2. Using comments on each line, generate the complete object code for the following SIC-XC program.…
A: Answer:- Object Code Generation:-
Q: def upgrade_stations(threshold: int, num_bikes: int, stations: List["Station"]) -> int: """Modify…
A: Code :- ID = 0 NAME = 1 LATITUDE = 2 LONGITUDE = 3 CAPACITY = 4 BIKES_AVAILABLE = 5…
Q: When we no longer need a module, we can get rid of it with this cmdlet: Group of answer choices…
A: Answer in step2
Q: Python Code: class Node: def __init__(self, initial_data): self.data = initial_data…
A: I give the code in Python along with output and code screenshot ( highlighted part is the edited…
Q: public void swapltems(ınt index1, int index2)
A: The given information refers that there is a single linked list and the method swapitems(int…
Q: public int method(char ch) { int aCount = 0, bCount = 0, cCount switch (ch) { 0; %3D %3D case 'A':…
A: For ch = 'A' or 'B' or 'C', the result will be 1.
Q: What collection-type data type is most useful with data values that are heterogeneous and may be…
A: EXPLANATION: An array is defined as the data structure that is used to store multiple numbers of…
Q: Exercise #3 Write the method searchKey (char key), which search data key' in the Iist and return its…
A: Note: Answering the question in python as no language is mentioned. Input : List of values Item to…
Q: detemine if the follow statement are true or False and why? screenshots show the ArrayBoundedStack…
A: Introduction: The ArrayBasedStack class is defined along with its attributes, constructors, and…
Q: Please help with the following code so that ouput is same as sample: import java.io.*; import…
A: Algorithm: Start Declare a hashset to store names Add unique names to the hashset till user enters…
Q: # A set of constants, each representing a list index for station information. ID = 0 NAME = 1…
A: Answer is given below-
Q: e.UpsertResult) srList - Dutabase.upsertlistotAccountsToUpdate, false):…
A: We are required to update the given code for the above listed problem statement:
Q: EDIT PAYMENTDAO.JAVA FILES SO IT PASSES TEST FROM CREDITCARDTEST.JAVA (CreditCardTest.java) package…
A: Answer is given below-
Q: Excute the Program about Hash and show me the result . Source code import java.util.*; import…
A: The given program is: import java.util.*; import java.io.*; class HashTable { public static void…
Q: IntSet unionWith(const IntSet& otherIntSet) const // Pre: size() +…
A: Function Definition: void IntSet::unionWith(const IntSet &otherIntSet) { assert((size() +…
Q: etting Null When Using the Below Code. ase.UpsertResult[] srList = Database.upsert(listOfAccounts…
A: Required:
Q: searchStudent: searches the studentsList by idNum, passed as parameter. If the object is found, it…
A: searchStudent: searches the studentsList by idNum, passed as parameter. If the object is found, it…
Q: IExit Full Screen RESPONSE AREA Organize answer blocks in the proper order: ANSWER BANK Move the…
A: NOTE: - Hi, Since the question contains multiple parts, so the first part is solved below.…
Q: Requirements: Use Java Programming only. Show screenshots of your work. 6. Write…
A: Since you have asked multiple question, we will solve the first question for you. If you want any…
Q: #include int arrC[10] = {0}; int bSearch(int arr[], int l, int h, int key); int…
A: Flowchart of above program:
Q: Assignment Apex: Add a new method: //Name: getcontactInformationUsingInlinesoQL //Return Type: Map>…
A: Given:
Q: This is a code in C, I need to change the code as much as possible, but on condition to perform the…
A: Given: According to your question, you asked just to change the variable names and loops. So this C…
Q: @return index of the point that is closest to the origin, which is (0, 0) * In case of a tie,…
A: ALGORITHM:- 1. Calculate the distance of the points from the origin. 2. Return the point with…
Q: Python Code: class Node: def __init__(self, initial_data): self.data = initial_data…
A: Python:- Reduced Coding Time:- An advantage of using functions and procedures is that coding time is…
Q: // Definition of copy constructor // Instructions omitted intentionally. // Your code
A: Here,in this section describe the following questions.. // Definition of copy constructor //…
Q: removeShortStrings
A: Program approach: Create the main method. Create a HashSet. Add some stings into HashSet using…
void removeStudent()
{
System.out.print("\n Enter StudentID to remove: ");
long id =sc.nextLong();
int pos = searchStudentID(id);
if(pos == -1)
System.out.println("\n ERROR: No student found having same ID: " + id);
else
courses.remove(pos);
}
int searchStudentID(long studentID)
{
for(int c = 0; c < students.size(); c++)
if(studentID == students.get(c).getId())
return c;
return -1;
}
The code is supposed to prompt the user to enter a studentID and if it is in the records then it will be removed, but instead it just prompts me to enter and when i enter the ID, it does not remove the ID (I display the data again after I supposedly removed it but it is still there) and just returns back to the menu. What can I do to correct it?
Step by step
Solved in 2 steps
- void removeStudent(){System.out.print("\n Enter StudentID to remove: ");long id =sc.nextLong();int pos = searchStudentID(id);if(pos == -1)System.out.println("\n ERROR: No student found having same ID: " + id);elsecourses.remove(pos);} int searchStudentID(long studentID){for(int c = 0; c < students.size(); c++)if(studentID == students.get(c).getId())return c;return -1;} The code is supposed to prompt the user to enter a studentID and if it is in the records then it will be removed, but instead it just prompts me to enter and when i enter the ID, it just exits and goes back to the menu. is there something wrong with my code?function loginValidate () { var id = document.getElementById ('myid').value; var pass = document.getElementById('mypassword').value; if ((id == null : id alert ("ID and Pasword both must be filled out") : "") && (pass == null , pass == ")){ == return false: else if (id == null || id == "") { alert ("ID must be filled out "); return false; else if (pass == null || pass == "") { alert ("Password must be filled out "); return false;function removeErrMsgs() { var errMessages = document.getElementsByClassName('msg');for (let msg of errMessages) {msg.innerHTML = "";}}function validateValues() {var toBeReturned = true;removeErrMsgs();var fname = document.getElementById("fname").value;if (fname.length > 30) {document.getElementsByClassName('msg')[0].innerHTML = "First name can not be longer than 30 characters";toBeReturned = false;} var lname = document.getElementById("lname").value;if (lname.length > 30) {document.getElementsByClassName('msg')[1].innerHTML = "Last name can not be longer than 30 characters";toBeReturned = false;} var phone = document.getElementById('num').value;if (phone.length > 8) {document.getElementsByClassName('msg')[2].innerHTML = "Phone number can not be greater than 8 numbers";toBeReturned = false;} var items = document.getElementById('items').value;if (items > 4 || items < 2) {document.getElementsByClassName('msg')[3].innerHTML = "Item numbers should be between 1 and…
- Implement all the classes using Java programming language from the given UML Class diagram. Note: This problem requires you to submit just two classes: Customer.java, Invoice.java. Do NOT include "public static void main()" method inside all of these classes. Graders will be testing your classes, using the unit-testing framework JUnit 4. Customer - ID:int -name:String -discount:int Discount rate in percent +Customer(ID:int,name:String, discount:int) +getID():int +getName ():String +getDiscount():int +setDiscount(discount:int):void +toString():String "name (ID)" The Customer class models, a customer design as shown in the class diagram. Write the codes for the Customer class and a test driver to test all the public methods. Invoice - ID:intPLEASE HELP ME! ? Maximize and use alternative method to this code! package com.btech.pf101; import java.io.bufferedreader; import java.io.inputstreamreader; import java.util.calendar; import java.util.date; public class pawnshopcode { private static final bufferedreader br = new bufferedreader(new inputstreamreader(system.in)); private static string name; private static int age; private static string address; private static string contactno; private static int itemtype; private static string itemtypename; private static final int itemtype_gagdet = 1; private static final int itemtype_jewelry = 2; private static final int itemtype_musicinstrument = 3; private static final int itemtype_homeequipment = 4; private static final int itemtype_landtitle = 5; private static string itemdescription; private static int periodtype; private static string periodtypename; private static final int periodtype_days = 1; private…6: opposites = {'up': 'down', 'right': 'wrong', 'true': 'false'} alias opposites = print(alias is opposites) alias ['right'] = 'left' print (opposites ['right']) 7: What is printed by the following statements? matrix = {(0, 3): 1, (2, 1): 2, (4, 3): 3} print (matrix.get((0,3))) print (matrix.get((1, 3), 0)) 8: What is printed by the following statements? a = set(range (3,10)) b = set (range (6,15)) print (a - b) print (a^ b) 9: What is printed by the following statements? alist = [4,2,8,6,5] blist = [num*2 for num in alist if num%2==1] print (blist) 10: What is printed by the following statements? g = lambda x: X*X*X print (g(7))
- A c++ code that performs a search for a specific employee and returns the employee ID if found and 0 if not: int findEmployeeById(Employee list[], int size, int myId)Implement all the classes using Java programming language from the given UML Class diagram. Note: This problem requires you to submit just two classes: Customer.java, Account.java. Do NOT include "public static void main()" method inside all of these classes. Graders will be testing your classes, using the unit-testing framework JUnit 4. Customer - ID:int -name:String -gender:char 'm' or 'f' +Customer(ID:int,name:String, discount:int) +getID():int +getName ():String +getGender ():char +toString():String "name (ID)" The Customer class models, customer design as shown in the class diagram. Write the codes for the Customer class and a test driver to test all the public methods. AccountWhy does a Random object's intended seed value correspond to the system time?
- struct insert_into_hash_table { // Function takes a constant Book as a parameter, inserts that book indexed by // the book's ISBN into a hash table, and returns nothing. void operator()(const Book& book) { ///// /// TO-DO (8) ||||. // Write the lines of code to insert the key (book's ISBN) and value // ("book") pair into "my_hash_table". /// END-TO-DO (8) // } std::unordered_map& my_hash_table; };Here is a statement: class temporary { public: void set(string, double, double); void print(); double manipulate(); void get(string&, double&, double&); void setDescription(string); void setFirst(double); void setSecond(double); string getDescription() const; double getFirst()const; double getSecond()const; temporary(string = "", double = 0.0, double = 0.0); private: string description; double first; double second; }; How can I write a definition of the member function manipulate that returns a decimal number as follows: If the value of description is "rectangle", it returns first * second; if the value of description is "circle", it returns the area of the circle with radius first; if the value of description is "sphere", it returns the volume of the sphere with radius first; if the value of description is "cylinder", it returns the volume of the cylinder with radius first and height second; otherwise, it returns the value -1.class temporary { public: void set(string, double, double); void print(); double manipulate(); void get(string&, double&, double&); void setDescription(string); void setFirst(double); void setSecond(double); string getDescription() const; double getFirst()const; double getSecond()const; temporary(string = "", double = 0.0, double = 0.0); private: string description; double first; double second; }; What are the members and functions in this example? I need help identifying how the members and functions work to answer the questions below. I am having troubles understanding this concept. I am learning constructors and deconstructors along with inline and hiding information. I feel lost trying to answer these questions. Can I get direction on how to proceed? Write the definition of the member function set so that the instance variables are set according to the parameters. Write the definition of the member function manipulate that returns a decimal number as follows: If the…