Would Write Body Insert Deleteat Delete Locate Methods Ve Tried Writing Code T Seem Get Wo Q43904602


How would we write the body for the insert(), deleteAt(),delete(), and the locate() methods? I’ve tried writing down somecode but can’t seem to get it to work.
* This class provides a growable array for primitive long values. * @author * @version 1.0 1/16/2020 */ class BigIntArrayList { //fields private long[] list; private int count; * Constructor. Initializes the underlying array to 10 elements. */ BigIntArrayList() { list = new long[10]; count = 0; Inserts the given long value at the given index. The index is assumed to be a value between 0 and count. Existing elements are moved up as needed to make room for the new value. * @param index the index where the new value should be stored * @param value the value to be stored */ public void insert(int index, long value) { count = list.length; count++; for (int i = count – 1; i > index; i–) { list[i] = list[i – 1]; list[index] = value; * Deletes the value at the given index. The index is * assumed to be a value between 0 and count – 1. Existing elements are moved down as needed to keep all values contiguous, without any empty spaces in the array. * @param index the index of the element that should be removed * @return the value that was removed */ public long deleteAt (int index) { long[] newList = new long[list.length – 1]; for (int i = 0; i < newList.length; i++) { newList[i] = list[i]; return 0; * Deletes the first instance of the given value. Existing elements * are moved down as needed to keep all values contiguous, without * any empty spaces in the array. If the value does not exist, this * method returns without doing anything. * @param value the value to remove public void delete (long value) { //TODO complete this method * Returns the value at the given index without removing it. The index is * assumed to be a value between 0 and count – 1. * @param index the index of the element * @return the value at that index public long getValueAt (int index) { //TODO complete this method return 0; //replace this return statement * Returns the index of the first instance of the given value * in the array. If the value doesn’t exist, -1 is returned. * @param value the value to find in the array * @return the index where the value was found, or -1 if not found public int locate (long value) { int index = -1; for (int i = 0; i < list.length; i++) { if (list[i] == value) { index = i; return index; * Provides access to the number of values currently in the array. * @return the number of values in the array */ public int getCount() { return count; Show transcribed image text * This class provides a growable array for primitive long values. * @author * @version 1.0 1/16/2020 */ class BigIntArrayList { //fields private long[] list; private int count; * Constructor. Initializes the underlying array to 10 elements. */ BigIntArrayList() { list = new long[10]; count = 0; Inserts the given long value at the given index. The index is assumed to be a value between 0 and count. Existing elements are moved up as needed to make room for the new value. * @param index the index where the new value should be stored * @param value the value to be stored */ public void insert(int index, long value) { count = list.length; count++; for (int i = count – 1; i > index; i–) { list[i] = list[i – 1]; list[index] = value; * Deletes the value at the given index. The index is * assumed to be a value between 0 and count – 1. Existing elements are moved down as needed to keep all values contiguous, without any empty spaces in the array. * @param index the index of the element that should be removed * @return the value that was removed */ public long deleteAt (int index) { long[] newList = new long[list.length – 1]; for (int i = 0; i
Expert Answer
Answer to How would we write the body for the insert(), deleteAt(), delete(), and the locate() methods? I’ve tried writing down so…
Would Write Body Tostring Methods Using Printf Statements Language Java Q43893494



How would we write the body of the toString() methods usingprintf statements?
Language: Java
/ * * * Provides a string representation of the current Money object, in * the form $mm.mm. Negative values have a minus sign before the dollar * sign. Zero dollar amounts are represented with one zero between the * dollar sign and the decimal point. Cents that are multiples of 10 * still show two decimal places. (Examples: $12.34, -$6.50, $0.99, * -$0.99, $0.00) * @return the string representation @Override public String toString() { return null; /** * Default constructor. Creates a new Money object. * Sets both dollars and cents to zero. public Money () { dollars = 0; cents = 0; * Full constructor. Creates a new Money object. Dollars and cents * are normalized. If one is negative and the other is * positive, the resulting object will be the natural addition of the two * values. (Example: 2 dollars and -5 cents is converted to i dollar * and 95 cents.) If the absolute value of cents is greater than 99, * the resulting object will carry the extra cents into the dollars. * (Example: 1 dollar and 105 cents is converted to 2 dollars and 5 cents.) * A negative value is represented with both the dollars and cents negative. * @param dollars the number of dollars in the amount @param cents the number of cents in the amount public Money (long dollars, byte cents) { long value = dollars * 100; value += cents; this.dollars = value / 100; this.cents = (byte) (value $ 100); * Provides access to the dollars portion of the monetary value. * @return the dollars portion of this Money object public long getDollars () { return dollars; /** * Provides access to the cents portion of the monetary value. * @return the cents portion of this money object */ public byte getCents() { return cents; * Adds the current and the given Money objects together, and stores * the sum in a new Money object. The current and given Money objects * are not altered in the process. The resulting Money object’s * dollars and cents are normalized as defined in the full constructor comments. * @param other the other Money object to add to this one * @return the Money object containing the results of this addition */ public Money add (Money other) { long value = dollars * 100; value += cents; long Value = other. dollars * 100; Value += other.cents; long result = value + Value; return new Money (result / 100, (byte) (result $ 100)); * Subtracts the given Money object from this one, and stores * the result in a new Money object. The current and given Money objects * are not altered in the process. The resulting Money object’s * dollars and cents are normalized as defined in the full constructor comments. * @param other the other Money object to subtract from this one * @return the Money object containing the results of this subtraction */ public Money subtract (Money other) { long value = dollars * 100; value += cents; long Value = other.dollars * 100; oValue += other.cents; long result = value – oValue; return new Money (result / 100, (byte) (result $ 100)); Show transcribed image text / * * * Provides a string representation of the current Money object, in * the form $mm.mm. Negative values have a minus sign before the dollar * sign. Zero dollar amounts are represented with one zero between the * dollar sign and the decimal point. Cents that are multiples of 10 * still show two decimal places. (Examples: $12.34, -$6.50, $0.99, * -$0.99, $0.00) * @return the string representation @Override public String toString() { return null;
/** * Default constructor. Creates a new Money object. * Sets both dollars and cents to zero. public Money () { dollars = 0; cents = 0; * Full constructor. Creates a new Money object. Dollars and cents * are normalized. If one is negative and the other is * positive, the resulting object will be the natural addition of the two * values. (Example: 2 dollars and -5 cents is converted to i dollar * and 95 cents.) If the absolute value of cents is greater than 99, * the resulting object will carry the extra cents into the dollars. * (Example: 1 dollar and 105 cents is converted to 2 dollars and 5 cents.) * A negative value is represented with both the dollars and cents negative. * @param dollars the number of dollars in the amount @param cents the number of cents in the amount public Money (long dollars, byte cents) { long value = dollars * 100; value += cents; this.dollars = value / 100; this.cents = (byte) (value $ 100); * Provides access to the dollars portion of the monetary value. * @return the dollars portion of this Money object public long getDollars () { return dollars; /** * Provides access to the cents portion of the monetary value. * @return the cents portion of this money object */ public byte getCents() { return cents;
* Adds the current and the given Money objects together, and stores * the sum in a new Money object. The current and given Money objects * are not altered in the process. The resulting Money object’s * dollars and cents are normalized as defined in the full constructor comments. * @param other the other Money object to add to this one * @return the Money object containing the results of this addition */ public Money add (Money other) { long value = dollars * 100; value += cents; long Value = other. dollars * 100; Value += other.cents; long result = value + Value; return new Money (result / 100, (byte) (result $ 100)); * Subtracts the given Money object from this one, and stores * the result in a new Money object. The current and given Money objects * are not altered in the process. The resulting Money object’s * dollars and cents are normalized as defined in the full constructor comments. * @param other the other Money object to subtract from this one * @return the Money object containing the results of this subtraction */ public Money subtract (Money other) { long value = dollars * 100; value += cents; long Value = other.dollars * 100; oValue += other.cents; long result = value – oValue; return new Money (result / 100, (byte) (result $ 100));
Expert Answer
Answer to How would we write the body of the toString() methods using printf statements? Language: Java…
Would Write C Something Reads Integers Using Scanf Sentinel Value 999 Read Value 999 Read Q43884632
How would I write in C something that reads in integers usingscanf() and then when a sentinel value of -999 is read. Then oncethe value -999 is read to display the sum of all values that wereread. Also excluding the value of the -999. So I would want the sumof all values excluding -999 that were read in. If you could showme how to do this in C i would greatly appreciate it.
Expert Answer
Answer to How would I write in C something that reads in integers using scanf() and then when a sentinel value of -999 is read. Th…
Wowinansit 4 2 19 Swx2 4 7 19 Mapo 4 9 19 Attx 4 12 19 Sptr 5 1 19 Swx1 S 7 19 Hv11 5 9 19 Q43829137
WOWINANSIT 4/2/19 SWX2 4/7/19 MAPO 4/9/19 ATTX 4/12/19 SPTR 5/1/19 SWX1 S/7/19 HV11 5/9/19 S2SC 5/9/19 ORRC Tennessee Atlantic US ENTER HERE ald 55 ANSWER THE QUESTIONS GIVEN BELOW 56 1) What is the Total Number of Units sold from Jan to May? 572) What is the Average Number of units sold from Jan to May? 58 3) On how many days (count) were sales made? 59 4) On above sales days, what was the minimum number of units sold 60 5) On above sales days, what was the maximum number of units sold 51 6) What was the total number of units sold in Feburary 62 7) What was the average number of units sold in March 63 8) What percentage of sales were made in May? 54 9) How many unit sales were made in Atlantic US” Sales region? 65 10) What percentage of total sales were made in Central US region? 66 11) On how many days were unit sales of more than 1500 made? 67 12) On how many days were unit sales of less than 1000 units made? Tip: Us Tip: Us NIIN MKTGABON WEEK I PROJECT Show transcribed image text WOWINANSIT 4/2/19 SWX2 4/7/19 MAPO 4/9/19 ATTX 4/12/19 SPTR 5/1/19 SWX1 S/7/19 HV11 5/9/19 S2SC 5/9/19 ORRC Tennessee Atlantic US ENTER HERE ald 55 ANSWER THE QUESTIONS GIVEN BELOW 56 1) What is the Total Number of Units sold from Jan to May? 572) What is the Average Number of units sold from Jan to May? 58 3) On how many days (count) were sales made? 59 4) On above sales days, what was the minimum number of units sold 60 5) On above sales days, what was the maximum number of units sold 51 6) What was the total number of units sold in Feburary 62 7) What was the average number of units sold in March 63 8) What percentage of sales were made in May? 54 9) How many unit sales were made in Atlantic US” Sales region? 65 10) What percentage of total sales were made in Central US region? 66 11) On how many days were unit sales of more than 1500 made? 67 12) On how many days were unit sales of less than 1000 units made? Tip: Us Tip: Us NIIN MKTGABON WEEK I PROJECT
Expert Answer
Answer to WOWINANSIT 4/2/19 SWX2 4/7/19 MAPO 4/9/19 ATTX 4/12/19 SPTR 5/1/19 SWX1 S/7/19 HV11 5/9/19 S2SC 5/9/19 ORRC Tennessee At…
Write 2 3 Page Response Technology Impacted Society Also Consider Information Technology E Q43795159
Write a 2-3 page response on “How technology has impactedsociety” also consider Information Technology and its effect.
Expert Answer
Answer to Write a 2-3 page response on “How technology has impacted society” also consider Information Technology and its effect….
Write 2 Paragraphs Juice Store Explanation Supplier Power Q43892165
Write 2 paragraphs about juice store with explanation ofSupplier Power.
Expert Answer
Answer to Write 2 paragraphs about juice store with explanation of Supplier Power….
Write 5 4 Pts Using Three Variables String Indexing Operators Python Expressions Evaluate Q43900001

write 5. (4 pts each) Using the three variables above, string indexing, and operators + and Python expressions that evaluate to: Expression Result UCSB CSS W20 UCSB CS8 UCSB CS8 school ] = course True 4. (2 pts each) Section 2.2 describes strings in Python, including the concepts of “dictionary order (also called “lexicographic order”), concatenation of strings, multiplication of strings by an integer, the in operator, the not in operation, the len() function, and string indexing. Review that material. Expression Result course + 2 Assuming the following assignment statements have been entered at the Python prompt in IDLE to create the three variables below, indicate the value of each of the expressions on the right: (school + ‘-‘)*2 qtr(1:3) I qtr > course school = “UCSB” course = “CS8” qtr – “W20” “CS” in school Show transcribed image text write 5. (4 pts each) Using the three variables above, string indexing, and operators + and Python expressions that evaluate to: Expression Result UCSB CSS W20 UCSB CS8 UCSB CS8 school ] = course True
4. (2 pts each) Section 2.2 describes strings in Python, including the concepts of “dictionary order (also called “lexicographic order”), concatenation of strings, multiplication of strings by an integer, the in operator, the not in operation, the len() function, and string indexing. Review that material. Expression Result course + 2 Assuming the following assignment statements have been entered at the Python prompt in IDLE to create the three variables below, indicate the value of each of the expressions on the right: (school + ‘-‘)*2 qtr(1:3) I qtr > course school = “UCSB” course = “CS8” qtr – “W20” “CS” in school
Expert Answer
Answer to write 5. (4 pts each) Using the three variables above, string indexing, and operators + and Python expressions that eval…
Write Addlast Method Linked List Java Q43818886
Write the addLast() method for the linked list. with JAVA
Expert Answer
Answer to Write the addLast() method for the linked list. with JAVA…
Write Addlast Method Linked List Might Precondition Method Getlast Q43818575
Write the addLast() method for the linked list.
What might be the precondition for this method: getLast()?
Expert Answer
Answer to Write the addLast() method for the linked list. What might be the precondition for this method: getLast()?…
Write Algorithm Istep Step Instructions Via Someone Could Walk Drive Origin Destination Pe Q43897841
Write an algorithm (istep-by-step instructions) via whichsomeone could walk or drive from some origin to some destination,perhaps a path that you yourself tend to travel. Take care tospecify what the origin and destination that you have in mind. Andtake care to use loops and conditions as needed, particularly ifthere might be obstacles (e.g., red lines). Assume that youralgorithm will be executed by a robot (or lost friend) who willfollow your directions precisely.
Expert Answer
Answer to Write an algorithm (istep-by-step instructions) via which someone could walk or drive from some origin to some destinati…