This is in Java,
Put data into array(s) for stock trades and a combination of abstract classes AND concrete classes should be set up in your code. You can set it up so the arrays are already populated.
Any of the variables/integers can be 100% made up. This should be in very basic code.
The stock trade data can be anything.. it doesn't even need to be stock trade, it can be anything. Just need to have the abstract classes / concrete classes demonstrated.
The following classes demonstrate the abstract and base classes. I created three classes, one Base class which is abstract, one derived class which implements the method of abstract class and a tester class which creates object of derived class and tests whole program. Let me know in case of any confusion
************************Abstract_Base.java*******************************
//This is the abstract class
// which can only be derived but not
//instantiated
import java.util.*;
public abstract class Abstract_Base {
int n=5;
ArrayList<String> stock_markets = new
ArrayList<String>(n);
ArrayList<Double> current_value = new
ArrayList<Double>(n);
public Abstract_Base() {
stock_markets.add("NASDAQ");
stock_markets.add("FTSE");
stock_markets.add("CAC");
stock_markets.add("DAX");
stock_markets.add("NIFTY");
current_value.add(7034.69);
current_value.add(6862.68);
current_value.add(4810.84);
current_value.add(10931.24);
current_value.add(10931.50);
}
//Following is the abstract method which
//needs to be implemented in derived class
abstract void printMarketValue();
}
************************Derived.java******************************
//This class extends the abstract class
//and implements the abstract methods
//this is concrete class
public class Derived extends Abstract_Base {
public Derived() {
System.out.println("Markets created");
}
//implementing the printMarketValue function
// of the abstract Base class
public void printMarketValue(){
for (int i=0; i<this.n; i++) {
System.out.print(this.stock_markets.get(i)+" -
"+this.current_value.get(i));
System.out.print(" ");
}
}
}
*******************Tester.java************************************
//This class creates actual objects
//and tests the whole program
public class Tester {
public static void main(String[] args)
{
Derived derived= new
Derived();
System.out.println("Market
Value");
derived.printMarketValue();
}
}

This is in Java, Put data into array(s) for stock trades and a combination of abstract...
Create the abstract data type IntSet used to implement a mathematical set of non-negative integers (includes zero). Each object of class IntSet can keep track of whether integers are in the set or not. Implement as follows. A set is to be represented internally as a bool array containing true and false. For example, if you call the array set, then set[num] is true if the integer num is in the set, false if num is not in the set....
****WRITE A JAVA PROGRAM THAT : Write a method named stretch that accepts an array of integers (that the user inputs) as a parameter and returns a new array twice as large as the original, replacing every integer from the original array with a pair of integers, each half the original. If a number in the original array is odd, then the first number in the new pair should be one higher than the second so that the sum equals...
Array with Iterator. Java style
Implement an array data structure as a class JstyArray<E>
to support the Iterable interface such that the following code
works:
JstyArray<Integer> data;
data = new JstyArray<Integer>(10);
for (int i = 0; i < 10; ++i) {
data.set(i, new Integer(i) );
}
int sum = 0;
for ( int v : data ) {
if (v == null)
continue; // empty cell
sum += v;
}
The iterator provided by this class follows the behaviour of...
Java question
Given an array of integer numbers, write a linear running time complexity program in Java to find the stability index in the given input array. For an array A consisting n integers elements, index i is a stability index in A itf ATO] + A[1] + +A[iI-1] Ali+1]+ Ali+2] +... + A[n-1]; where 0 <i< n-1 Similarly, 0 is an stability index if (A[1] A[2]A[n-1]) 0 and n-1 is an stability index if (A[0] A[1]+... A[n-21) 0 Example:...
Given an array of integer numbers, write a linear running time complexity program in Java to find the stability index in the given input array. For an array A consisting n integers elements, index i is a stability index in A if A[0] + A[1] + ... + A[i-1] = A[i+1] + A[i+2] + ... + A[n-1]; where 0 < i < n-1. Similarly, 0 is an stability index if (A[1] + A[2] + ... + A[n-1]) = 0 and...
This should be in Java Create a simple hash table You should use an array for the hash table, start with a size of 5 and when you get to 80% capacity double the size of your array each time. You should create a class to hold the data, which will be a key, value pair You should use an integer for you key, and a String for your value. For this lab assignment, we will keep it simple Use...
PART I: Create an abstract Java class named “Student” in a package named “STUDENTS”. This class has 4 attributes: (1) student ID: protected, an integer of 10 digits (2) student name: protected (3) student group code: protected, an integer (1 for undergraduates, 2 for graduate students) (4) student major: protected (e.g.: Business, Computer Sciences, Engineering) Class Student declaration provides a default constructor, get-methods and set-methods for the attributes, a public abstract method (displayStudentData()). PART II: Create a Java class named...
Sorting Threads Assignment Overview Write a multithreaded sorting program in Java which uses the merge sort algorithm. The basic steps of merge sort are: 1) divide a collection of items into two lists of equal size, 2) use merge sort to separately sort each of the two lists, and 3) combine the two sorted lists into one sorted list. Of course, if the collection of items is just asingle item then merge sort doesn’t need to perform the three steps,...
Java Code please read comments and add the code to required lines....LINE 1 to LINE 5 ********************************************************************** * Program Summary: This program demonstrates these basic Java concepts: * - Creating an array based on user input * - Accessing and displaying elements of the array * * The program should declare an array to hold 10 integers. * The program should then ask the user for an integer. * The program should populate the array by assigning the user-input integer...
package week_3; /** Write a method called countUppercase that takes a String array argument. You can assume that every element in the array is a one-letter String, for example String[] test = { "a", "B", "c", "D", "e"}; This method will count the number of uppercase letters from the set A through Z in the array, and return that number. So for the example array above, your method will return 2. You will need to use some Java library methods....