forked from Denisolt/CSCI-160
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFinal5.java
More file actions
43 lines (39 loc) · 1014 Bytes
/
Final5.java
File metadata and controls
43 lines (39 loc) · 1014 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import java.util.Scanner;
import java.util.LinkedList;
/**
* Write a description of class test here.
*
* @author (your name)
* @version (a version number or a date)
*/
public class Final5
{
Scanner input = new Scanner(System.in);
LinkedList<String>stock;
int n;
void getVal()
{
input = new Scanner(System.in);
stock = new LinkedList<String>();
System.out.println("Linked List - Add & Remove stock using index");
System.out.println("\nEnter number of stock: ");
n = input.nextInt();
System.out.println("Enter the stock data: ");
for(int i =0; i<n; i++)
{
stock.add(input.next());
}
}
void display()
{
System.out.println(stock);
}
void AddIndex()
{
System.out.println("add using index");
System.out.println("enter the index");
n = input.nextInt();
System.out.println("enter the stock data");
n = input.nextInt();
}
}