Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Search & Filtering

Please explain this code or simulate this.




public SortedLinearArray(int size) {



array = new int[size];



currentSize = 0;



}




public void insertItem(int item) {



if (currentSize < array.length) {



int insertLocation = findLocationInsert(item);



for (int i = currentSize - 1; i >= insertLocation; i--) {



array[i + 1] = array[i];



}



array[insertLocation] = item;



currentSize++;



}



}




private int findLocationInsert(int item) {



for (int i = 0; i < currentSize; i++) {



if (array[i] > item) {



return i;



}



}



return currentSize;



}




public void deleteItem(int item) {



int deleteLocation = findLocationDelete(item);



if (deleteLocation != -1) {



for (int i = deleteLocation + 1; i < currentSize; i++) {



array[i - 1] = array[i];



}



currentSize--;



}



}




private int findLocationDelete(int item) {



for (int i = 0; i < currentSize; i++) {



if (array[i] == item) {



return i;



}



}



return -1;



}




Create an application that receives an internet application from a company’s prospective customers. The following information must be received from the applicant: - Name - Internet Choice - Applicant salary In the event that the “Check application” button is clicked, the complete application result must be displayed in the listbox control of a second form. The label control of the second form must simply indicate whether an application is “approved” or “not approved” If a user has a salary of R2500 or less, then the application cannot be approved, else the application will be approved. 


6. Integer Pairing

by CodeChum Admin

Now this one's a tad bit tricky, but you can definitely do it!


Instructions:

  1. Input five integers.
  2. Add the 1st and 2nd integers together and store the sum inside a variable.
  3. Add the 3rd and 4th integers together and store the sum inside a variable.
  4. Multiply the two sums and raise the product result to the power of the 5th integer.
  5. Print out the result.

Input


1. First integer

2. Second integer

3. Third integer

4. Fourth integer

5. Fifth integer

Output

The first five lines will contain message prompts to input the five integers.

The line contains the result.

Enter·integer·1:·2
Enter·integer·2:·3
Enter·integer·3:·3
Enter·integer·4:·5
Enter·integer·5:·4
Result·=·2560000





An electric company bases its charges on two rates, customers are charged P25.00 per kilowatt-hour for the first 300 kilowatt-hours used in a month and P30.00 each for all kilowatt-hours used thereafter. Compute for the amount due from a customer after reading the kilowatt-hours used. Assume that there are 100 records of customers.



Draw a flowchart, write an algorithm and design a C++ program for an inventory system that will alert the user to reorder an item based on:

a. The stock-on-hand or an order is below the reorder print.

b. The item is not obsolete.

Use the selection structure.


4. What's in There?

by CodeChum Admin



Instructions:

  1. Create a variable that accepts a positive integer.
  2. Create an empty list. Then, using loops, add string values to your list using the input() function. The number of string values to be added are dependent on the inputted value on the first inputted integer.
  3. Create another variable that accepts a non-negative integer. The number must only range from 0 until the value of the first inputted integer.
  4. Using your understanding on accessing list elements, access and print out the list element having the index position of the second inputted integer.



Input

The first line contains an integer n which is the size of the array.

The next n lines contains a string on each.

The last line contains an integer which is the index to be accessed and printed.

6
Learning
Programming
made
easy
with
Cody!
5



Output

A line containing a string.

Cody!

1. String Replacement

by CodeChum Admin



Instructions:

  1. Create two variables that will accept string values.
  2. A list containing three string values is already given to you in the code editor on the side. First, insert the first inputted string to the end of the list.
  3. Then, insert the second inputted string into the beginning of the list.
  4. There are now 5 elements on the given list. Now, remove the 4th element of the list. Apply the concept of index positions in order to access the 4th string element and successfully remove it from the list.
  5. Print out the remaining contents on the list, each separated by a new line, using loops.


Input

Two lines containing a string.

fun
Python


Output

A line containing a string.

Python is really fun

2. Cubes and Squares

by CodeChum Admin


Instructions:

  1. An array containing 40 integer elements is already provided for you in the code editor below.
  2. Using loops and conditions, print out the cube of the array element if it is a positive number, and print out the square of the number if it is negative. Each result must be printed out separately by each line.



Output

The squares and cubes of the elements in the array.

4
1
1
8
27
.
.
.

Write a program that allows the user to enter the coal usage at a power station for the first and second week of October in metric tonnes which is as follows:



Week 1: 29,31,29,30,30,28,35



Week 2: 33,37,28,32,31,30,32

List and describe using relevant examples, the five Tuckman's stages of team development

LATEST TUTORIALS
APPROVED BY CLIENTS