(New Full Course Guide) CSIS 312 – Advanced Object-Oriented Programming Liberty University

(New Full Course Guide) CSIS 312 – Advanced Object-Oriented Programming Liberty University

$79.99
Skip to product information
(New Full Course Guide) CSIS 312 – Advanced Object-Oriented Programming Liberty University

(New Full Course Guide) CSIS 312 – Advanced Object-Oriented Programming Liberty University

$79.99

CSIS 312 Entire Course Liberty University Study Guide Solution Download:

CSIS 312 Assignment 1 Time2 Class,

CSIS 312 Assignment 2 Employee Class,

CSIS 312 Assignment 3 Payroll System,

CSIS 312 Assignment 4 Random Sentences,

CSIS 312 Assignment 5 LinkedList Object,

CSIS 312 Assignment 7 Pair Class,

CSIS 312 Assignment 6 Print Array,

CSIS 312 Assignment 8 SecureRandom

CSIS 312 Assignment 6 Print Array

Write a recursive method printArray() that displays all the elements in an array of integers, separated by spaces. The array must be 100 elements in size and filled using a for loop and a random number generator. The pseudo-code for this is as follows:

 

//Instantiate an integer array of size 100

 

//fill the array

 

For (int i=0; i<array.length; i++)

 

Array[i] = random number between 1 and 100 inclusive

 

printArray(integer array);

 

For both assignments make sure that your screen shots show your program running and that your runtime display shows that your program does all that is required of it.  You only get credit for what you demonstrate.

 

 

 

 

 

CSIS 312 Assignment 6 Screenshot

You May Also Like:

CSIS 312 Entire Course

CSIS 312 Assignment 2 Employee Class

CSIS 312 Assignment 3 Payroll System

CSIS 312 Assignment 4 Random Sentences

CSIS 312 Assignment 5 LinkedList Object

CSIS 312 Assignment 6 printArray and Factorial Calculator

CSIS 312 Assignment 7 Pair Class

CSIS 312 Assignment 8 Stack Data Structure

CSIS 312 Assignment 8 SecureRandom

 

 

CSIS 312 Assignment 8 SecureRandom

Write a program that inserts 25 random numbers from 0 to 99 (using SecureRandom) inclusive into a linked-list object in sorted order and then calls the linked-list object’s print() method.

The following files are provided for you and must be used for this exercise:

·      SortedList.java

o  Modify the insertSorted() method to create a sorted list. Feel free to use any ListNode or SortedList method. If you add any new methods they must be called either directly or indirectly from insertSorted().

o  Do not modify or change any other aspect of SortedList.java.

o  ListTest.java should not be changed except to enter your name in the place designated for it.

·      EmptyListException.java which is used by SortedList and ListTest and should not be changed or modified at all.

Note: If you do not use your modified insertSorted() method to sort your list as you build it, you will not get any credit for your work. Also, if you use Collections.sort() or Arrays.sort() or any pre-written sorting function to sort your list you will not get any credit for the assignment.

 

Make sure that your screen shot(s) show your program running and that your runtime display shows that your program does all that is required of it. You only get credit for what you demonstrate.

 

 

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

44

45

46

47

48

49

50

51

52

53

54

55

56

57

58

59

60

61

62

63

64

65

66

67

68

69

70

71

72

73

74

75

76

77

78

79

80

81

82

83

84

85

86

87

88

89

90

91

92

93

94

95

96

97

98

99

100

101

102

103

104

105

106

107

108

109

110

111

112

113

114

115

116

117

118

119

120

121

122

123

124

125

126

127

128

129

130

131

132

133

134

135

136

137

138

139

140

141

142

143

144

145

146

147

148

149

150

151

152

153

154

155

156

157

158

159

160

161

162

163

164

165

166

167

168

169

170

171

172

173

174

175

176

177

178

179

180

181

182

183

184

185

186

187

188

189

190

191

192

193

194

195

196

197

198

199

200

201

202

203

204

205

206

207

208

209

210

211

212

213

214

215

216

217

218

219

220

221

222

223

224

 

// Fig. 21.4: EmptyListException.java

// Class EmptyListException declaration.

  

public class EmptyListException extends RuntimeException

{

  // constructor

  public EmptyListException()

  {

     this(&amp;amp;quot;List&amp;amp;quot;); // call other EmptyListException constructor

  }

  

  // constructor

  public EmptyListException(String name)

  {

     super(name + &amp;amp;quot; is empty&amp;amp;quot;); // call superclass constructor

  }

} // end class EmptyListException

 

 

 

 

// Based on Fig. 21.5: ListTest.java

// ListTest class to demonstrate SortedList capabilities.

import java.security.SecureRandom;

  

public class ListTest

{

  public static void main(String[] args)

  {

     System.out.println(&amp;amp;quot;&amp;amp;amp;lt;Your name goes here -- Lab #8n&amp;amp;quot;);

      

     SortedList&amp;amp;amp;lt;Integer&amp;amp;amp;gt; list = new SortedList&amp;amp;amp;lt;&amp;amp;amp;gt;();

     SecureRandom rNum = new SecureRandom();

  

     // insert 25 random (between 0 and 99 inclusive) integers into the list

     for (int i = 0; i &amp;amp;amp;lt; 25; i++)

           //Your job is to modify insertSorted so that it creates a

           //sorted list one element at a time.

         list.insertSorted(rNum.nextInt(100));

  

     list.print();

} // end class ListTest

  

 

 

 

 

// Based on Fig. 21.3: List.java

// ListNode and SortedList class declarations.

  

// class to represent one node in a list

class ListNode&amp;amp;amp;lt;T extends Comparable&amp;amp;amp;lt;T&amp;amp;amp;gt;&amp;amp;amp;gt;

{

  // package access members; SortedList can access these directly

  T data; // data for this node

  ListNode&amp;amp;amp;lt;T&amp;amp;amp;gt; nextNode; // reference to the next node in the list

  

  // constructor creates a ListNode that refers to object

  ListNode(T object)

  {

     this(object, null);

  }

  

  // constructor creates ListNode that refers to the specified

  // object and to the next ListNode

  ListNode(T object, ListNode&amp;amp;amp;lt;T&amp;amp;amp;gt; node)

  {

     data = object;  

     nextNode = node;

  }

  

  // return reference to data in node

  T getData()

  {

     return data;

  }

  

  // return reference to next node in list

  ListNode&amp;amp;amp;lt;T&amp;amp;amp;gt; getNext()

  {

     return nextNode;

  }

} // end class ListNode&amp;amp;amp;lt;T&amp;amp;amp;gt;

  

// class SortedList definition

public class SortedList&amp;amp;amp;lt;T extends Comparable&amp;amp;amp;lt;T&amp;amp;amp;gt;&amp;amp;amp;gt;

{

  private ListNode&amp;amp;amp;lt;T&amp;amp;amp;gt; firstNode;

  private ListNode&amp;amp;amp;lt;T&amp;amp;amp;gt; lastNode;

  private String name; // string like &amp;amp;quot;list&amp;amp;quot; used in printing

  

  // constructor creates empty SortedList with &amp;amp;quot;list&amp;amp;quot; as the name

  public SortedList()

  {

     this(&amp;amp;quot;list&amp;amp;quot;);

  }

  

  // constructor creates an empty SortedList with a name

  public SortedList(String listName)

  {

     name = listName;

     firstNode = lastNode = null;

  }

   

  // insert &amp;amp;quot;insertItem&amp;amp;quot; into the proper position within the sorted list

  public void insertSorted(T insertItem)

  {

      // Complete insertSorted() so that insertItem is added to the list

      // in sorted order. Use the compareTo() method (part of the interface

      // Comparable) to do lesser/greater than comparisons of type T objects.

      // See Section 20.4 and Fig 21.15 for more information on compareTo and

      // Examples of its use.

       

      // Use insertAtFront(), insertAtBack(), and insert() as necessary to

      // place insertItem in its proper place in the list.

       

      // Do not change any of the class signatures nor any of the methods in

      // this file.

       

      // You may delete these comments, but be sure you follow the guidance

      // provided.

       

      // If you use Collections.sort() or Arrays.sort() or any similar pre-written

      // sorting function, you will not get any credit for your work.

  }

   

  private void insert(T insertItem, ListNode&amp;amp;amp;lt;T&amp;amp;amp;gt; previousNode)

  {

      previousNode.nextNode = new ListNode(insertItem, previousNode.nextNode);

  }

   

  // insert item at front of SortedList

  private void insertAtFront(T insertItem)

  {

     if (isEmpty()) // firstNode and lastNode refer to same object

        firstNode = lastNode = new ListNode&amp;amp;amp;lt;T&amp;amp;amp;gt;(insertItem);

     else // firstNode refers to new node

        firstNode = new ListNode&amp;amp;amp;lt;T&amp;amp;amp;gt;(insertItem, firstNode);

  }

  

  // insert item at end of SortedList

  private void insertAtBack(T insertItem)

  {

     if (isEmpty()) // firstNode and lastNode refer to same object

        firstNode = lastNode = new ListNode&amp;amp;amp;lt;T&amp;amp;amp;gt;(insertItem);

     else // lastNode's nextNode refers to new node

        lastNode = lastNode.nextNode = new ListNode&amp;amp;amp;lt;T&amp;amp;amp;gt;(insertItem);

  }

  

  // remove first node from SortedList

  public T removeFromFront() throws EmptyListException

  {

     if (isEmpty()) // throw exception if SortedList is empty

        throw new EmptyListException(name);

  

     T removedItem = firstNode.data; // retrieve data being removed

  

     // update references firstNode and lastNode

     if (firstNode == lastNode)

        firstNode = lastNode = null;

     else

        firstNode = firstNode.nextNode;

  

     return removedItem; // return removed node data

  } // end method removeFromFront

  

  // remove last node from SortedList

  public T removeFromBack() throws EmptyListException

  {

     if (isEmpty()) // throw exception if SortedList is empty

        throw new EmptyListException(name);

  

     T removedItem = lastNode.data; // retrieve data being removed

  

     // update references firstNode and lastNode

     if (firstNode == lastNode)

        firstNode = lastNode = null;

     else // locate new last node

     {

        ListNode&amp;amp;amp;lt;T&amp;amp;amp;gt; current = firstNode;

  

        // loop while current node does not refer to lastNode

        while (current.nextNode != lastNode)

           current = current.nextNode;

   

        lastNode = current; // current is new lastNode

        current.nextNode = null;

     }

  

     return removedItem; // return removed node data

  }

  

  // determine whether list is empty

  public boolean isEmpty()

  {

     return firstNode == null; // return true if list is empty

  }

  

  // output list contents

  public void print()

  {

     if (isEmpty())

     {

        System.out.printf(&amp;amp;quot;Empty %s%n&amp;amp;quot;, name);

        return;

     }

  

     System.out.printf(&amp;amp;quot;The %s is: &amp;amp;quot;, name);

     ListNode&amp;amp;amp;lt;T&amp;amp;amp;gt; current = firstNode;

  

     // while not at end of list, output current node's data

     while (current != null)

     {

        System.out.printf(&amp;amp;quot;%s &amp;amp;quot;, current.data);

        current = current.nextNode;

     }

  

     System.out.println();

  }

}

&amp;amp;lt;!-- /wp:shortcode --&amp;amp;gt;

 

&amp;amp;lt;!-- wp:paragraph --&amp;amp;gt;

&amp;amp;lt;p&amp;amp;gt;

 

 

 

 

 

You May Also Like:

CSIS 312 Entire Course

CSIS 312 Assignment 2 Employee Class

CSIS 312 Assignment 3 Payroll System

CSIS 312 Assignment 4 Random Sentences

CSIS 312 Assignment 5 LinkedList Object

CSIS 312 Assignment 6 printArray and Factorial Calculator

CSIS 312 Assignment 7 Pair Class

CSIS 312 Assignment 8 Stack Data Structure

CSIS 312 Assignment 6 Print Array

 

 

CSIS 312 Entire Course

CSIS 312 entire course includes:

 

CSIS 312 Assignment 1 Time2 Class

CSIS 312 Assignment 2 Employee Class

CSIS 312 Assignment 3 Payroll System

CSIS 312 Assignment 4 Random Sentences

CSIS 312 Assignment 5 LinkedList Object

CSIS 312 Assignment 6 Factorial Calculator

CSIS 312 Assignment 6 Print Array

CSIS 312 Assignment 7 Pair Class

 

Each tutorial includes:

 

Java code

Classes

Submittal document

Screenshots

 

SCREENSHOTS PAYMENT

 

 

 

You May Also Like:

CSIS 312 Assignment 1 Time2 Class

CSIS 312 Assignment 2 Employee Class

CSIS 312 Assignment 3 Payroll System

CSIS 312 Assignment 4 Random Sentences

CSIS 312 Assignment 5 LinkedList Object

CSIS 312 Assignment 6 printArray and Factorial Calculator

CSIS 312 Assignment 7 Pair Class

CSIS 312 Assignment 8 Stack Data Structure

 

 

CSIS 312 Assignment 8 Stack Data Structure

Write a program that inserts 25 random numbers from 0 to 99 (using SecureRandom) inclusive into a linked-list object in sorted order and then calls the linked-list object’s print() method.

The following files are provided for you and must be used for this exercise:

·      SortedList.java

o  Modify the insertSorted() method to create a sorted list. Feel free to use any ListNode or SortedList method. If you add any new methods they must be called either directly or indirectly from insertSorted().

o  Do not modify or change any other aspect of SortedList.java.

o  ListTest.java should not be changed except to enter your name in the place designated for it.

·      EmptyListException.java which is used by SortedList and ListTest and should not be changed or modified at all.

Note: If you do not use your modified insertSorted() method to sort your list as you build it, you will not get any credit for your work. Also, if you use Collections.sort() or Arrays.sort() or any pre-written sorting function to sort your list you will not get any credit for the assignment.

 

Make sure that your screen shot(s) show your program running and that your runtime display shows that your program does all that is required of it. You only get credit for what you demonstrate.

 

 

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

44

45

46

47

48

49

50

51

52

53

54

55

56

57

58

59

60

61

62

63

64

65

66

67

68

69

70

71

72

73

74

75

76

77

78

79

80

81

82

83

84

85

86

87

88

89

90

91

92

93

94

95

96

97

98

99

100

101

102

103

104

105

106

107

108

109

110

111

112

113

114

115

116

117

118

119

120

121

122

123

124

125

126

127

128

129

130

131

132

133

134

135

136

137

138

139

140

141

142

143

144

145

146

147

148

149

150

151

152

153

154

155

156

157

158

159

160

161

162

163

164

165

166

167

168

169

170

171

172

173

174

175

176

177

178

179

180

181

182

183

184

185

186

187

188

189

190

191

192

193

194

195

196

197

198

199

200

201

202

203

204

205

206

207

208

209

210

211

212

213

214

215

216

217

218

219

220

221

222

223

224

 

// Fig. 21.4: EmptyListException.java

// Class EmptyListException declaration.

  

public class EmptyListException extends RuntimeException

{

  // constructor

  public EmptyListException()

  {

     this(&amp;amp;quot;List&amp;amp;quot;); // call other EmptyListException constructor

  }

  

  // constructor

  public EmptyListException(String name)

  {

     super(name + &amp;amp;quot; is empty&amp;amp;quot;); // call superclass constructor

  }

} // end class EmptyListException

 

 

 

 

// Based on Fig. 21.5: ListTest.java

// ListTest class to demonstrate SortedList capabilities.

import java.security.SecureRandom;

  

public class ListTest

{

  public static void main(String[] args)

  {

     System.out.println(&amp;amp;quot;&amp;amp;amp;lt;Your name goes here -- Lab #8n&amp;amp;quot;);

      

     SortedList&amp;amp;amp;lt;Integer&amp;amp;amp;gt; list = new SortedList&amp;amp;amp;lt;&amp;amp;amp;gt;();

     SecureRandom rNum = new SecureRandom();

  

     // insert 25 random (between 0 and 99 inclusive) integers into the list

     for (int i = 0; i &amp;amp;amp;lt; 25; i++)

           //Your job is to modify insertSorted so that it creates a

           //sorted list one element at a time.

         list.insertSorted(rNum.nextInt(100));

  

     list.print();

} // end class ListTest

  

 

 

 

 

// Based on Fig. 21.3: List.java

// ListNode and SortedList class declarations.

  

// class to represent one node in a list

class ListNode&amp;amp;amp;lt;T extends Comparable&amp;amp;amp;lt;T&amp;amp;amp;gt;&amp;amp;amp;gt;

{

  // package access members; SortedList can access these directly

  T data; // data for this node

  ListNode&amp;amp;amp;lt;T&amp;amp;amp;gt; nextNode; // reference to the next node in the list

  

  // constructor creates a ListNode that refers to object

  ListNode(T object)

  {

     this(object, null);

  }

  

  // constructor creates ListNode that refers to the specified

  // object and to the next ListNode

  ListNode(T object, ListNode&amp;amp;amp;lt;T&amp;amp;amp;gt; node)

  {

     data = object;  

     nextNode = node;

  }

  

  // return reference to data in node

  T getData()

  {

     return data;

  }

  

  // return reference to next node in list

  ListNode&amp;amp;amp;lt;T&amp;amp;amp;gt; getNext()

  {

     return nextNode;

  }

} // end class ListNode&amp;amp;amp;lt;T&amp;amp;amp;gt;

  

// class SortedList definition

public class SortedList&amp;amp;amp;lt;T extends Comparable&amp;amp;amp;lt;T&amp;amp;amp;gt;&amp;amp;amp;gt;

{

  private ListNode&amp;amp;amp;lt;T&amp;amp;amp;gt; firstNode;

  private ListNode&amp;amp;amp;lt;T&amp;amp;amp;gt; lastNode;

  private String name; // string like &amp;amp;quot;list&amp;amp;quot; used in printing

  

  // constructor creates empty SortedList with &amp;amp;quot;list&amp;amp;quot; as the name

  public SortedList()

  {

     this(&amp;amp;quot;list&amp;amp;quot;);

  }

  

  // constructor creates an empty SortedList with a name

  public SortedList(String listName)

  {

     name = listName;

     firstNode = lastNode = null;

  }

   

  // insert &amp;amp;quot;insertItem&amp;amp;quot; into the proper position within the sorted list

  public void insertSorted(T insertItem)

  {

      // Complete insertSorted() so that insertItem is added to the list

      // in sorted order. Use the compareTo() method (part of the interface

      // Comparable) to do lesser/greater than comparisons of type T objects.

      // See Section 20.4 and Fig 21.15 for more information on compareTo and

      // Examples of its use.

       

      // Use insertAtFront(), insertAtBack(), and insert() as necessary to

      // place insertItem in its proper place in the list.

       

      // Do not change any of the class signatures nor any of the methods in

      // this file.

       

      // You may delete these comments, but be sure you follow the guidance

      // provided.

       

      // If you use Collections.sort() or Arrays.sort() or any similar pre-written

      // sorting function, you will not get any credit for your work.

  }

   

  private void insert(T insertItem, ListNode&amp;amp;amp;lt;T&amp;amp;amp;gt; previousNode)

  {

      previousNode.nextNode = new ListNode(insertItem, previousNode.nextNode);

  }

   

  // insert item at front of SortedList

  private void insertAtFront(T insertItem)

  {

     if (isEmpty()) // firstNode and lastNode refer to same object

        firstNode = lastNode = new ListNode&amp;amp;amp;lt;T&amp;amp;amp;gt;(insertItem);

     else // firstNode refers to new node

        firstNode = new ListNode&amp;amp;amp;lt;T&amp;amp;amp;gt;(insertItem, firstNode);

  }

  

  // insert item at end of SortedList

  private void insertAtBack(T insertItem)

  {

     if (isEmpty()) // firstNode and lastNode refer to same object

        firstNode = lastNode = new ListNode&amp;amp;amp;lt;T&amp;amp;amp;gt;(insertItem);

     else // lastNode's nextNode refers to new node

        lastNode = lastNode.nextNode = new ListNode&amp;amp;amp;lt;T&amp;amp;amp;gt;(insertItem);

  }

  

  // remove first node from SortedList

  public T removeFromFront() throws EmptyListException

  {

     if (isEmpty()) // throw exception if SortedList is empty

        throw new EmptyListException(name);

  

     T removedItem = firstNode.data; // retrieve data being removed

  

     // update references firstNode and lastNode

     if (firstNode == lastNode)

        firstNode = lastNode = null;

     else

        firstNode = firstNode.nextNode;

  

     return removedItem; // return removed node data

  } // end method removeFromFront

  

  // remove last node from SortedList

  public T removeFromBack() throws EmptyListException

  {

     if (isEmpty()) // throw exception if SortedList is empty

        throw new EmptyListException(name);

  

     T removedItem = lastNode.data; // retrieve data being removed

  

     // update references firstNode and lastNode

     if (firstNode == lastNode)

        firstNode = lastNode = null;

     else // locate new last node

     {

        ListNode&amp;amp;amp;lt;T&amp;amp;amp;gt; current = firstNode;

  

        // loop while current node does not refer to lastNode

        while (current.nextNode != lastNode)

           current = current.nextNode;

   

        lastNode = current; // current is new lastNode

        current.nextNode = null;

     }

  

     return removedItem; // return removed node data

  }

  

  // determine whether list is empty

  public boolean isEmpty()

  {

     return firstNode == null; // return true if list is empty

  }

  

  // output list contents

  public void print()

  {

     if (isEmpty())

     {

        System.out.printf(&amp;amp;quot;Empty %s%n&amp;amp;quot;, name);

        return;

     }

  

     System.out.printf(&amp;amp;quot;The %s is: &amp;amp;quot;, name);

     ListNode&amp;amp;amp;lt;T&amp;amp;amp;gt; current = firstNode;

  

     // while not at end of list, output current node's data

     while (current != null)

     {

        System.out.printf(&amp;amp;quot;%s &amp;amp;quot;, current.data);

        current = current.nextNode;

     }

  

     System.out.println();

  }

}

&amp;amp;lt;!-- /wp:shortcode --&amp;amp;gt;

 

&amp;amp;lt;!-- wp:paragraph --&amp;amp;gt;

&amp;amp;lt;p&amp;amp;gt;

 

 

 

 

 

You May Also Like:

CSIS 312 Entire Course

CSIS 312 Assignment 2 Employee Class

CSIS 312 Assignment 3 Payroll System

CSIS 312 Assignment 4 Random Sentences

CSIS 312 Assignment 5 LinkedList Object

CSIS 312 Assignment 6 printArray and Factorial Calculator

CSIS 312 Assignment 7 Pair Class

CSIS 312 Assignment 8 Stack Data Structure

CSIS 312 Assignment 6 Print Array

 

 

CSIS 312 Assignment 7 Pair Class

Write a generic class Pair which has two type parameters—F and S—each representing the type of the first and second element of the pair, respectively. Add set and get methods for the first and second elements of the pair and be sure to demonstrate your setters/getters actually work. (Hint: The class header should be public class Pair<F, S> and the best way to demonstrate your setters is to call them from your constructor(s).)

 

Write a separate PairTest class to test class Pair. Create 2 Pair types and test your get and set methods on the following pair types:

 

Pair<Integer, String> p1 takes Integer and String types as a pair

Pair<String, Integer> p2 takes String and Integer

 

PairTest should output enough information to the terminal to show that your generic class Pair is able to set() and get() different types

 

 

 

 

 

CSIS 312 – ADVANCED OBJECT-ORIENTED PROGRAMMING Assignment 7

You May Also Like:

CSIS 312 Entire Course

CSIS 312 Assignment 1 Time2 Class

CSIS 312 Assignment 2 Employee Class

CSIS 312 Assignment 3 Payroll System

CSIS 312 Assignment 4 Random Sentences

CSIS 312 Assignment 5 LinkedList Object

CSIS 312 Assignment 6 printArray and Factorial Calculator

CSIS 312 Assignment 8 Stack Data Structure

 

 

CSIS 312 Assignment 6 printArray and Factorial Calculator

Write a recursive method printArray() that displays all the elements in an array of integers, separated by spaces. The array must be 100 elements in size and filled using a for loop and a random number generator. The pseudo-code for this is as follows:

 

//Instantiate an integer array of size 100

 

//fill the array

 

For (int i=0; i<array.length; i++)

 

Array[i] = random number between 1 and 100 inclusive

 

printArray(integer array);

 

For both assignments make sure that your screen shots show your program running and that your runtime display shows that your program does all that is required of it.  You only get credit for what you demonstrate.

 

 

 

 

 

CSIS 312 Assignment 6 Screenshot

You May Also Like:

CSIS 312 Entire Course

CSIS 312 Assignment 2 Employee Class

CSIS 312 Assignment 3 Payroll System

CSIS 312 Assignment 4 Random Sentences

CSIS 312 Assignment 5 LinkedList Object

CSIS 312 Assignment 6 printArray and Factorial Calculator

CSIS 312 Assignment 7 Pair Class

CSIS 312 Assignment 8 Stack Data Structure

CSIS 312 Assignment 8 SecureRandom

 

 

CSIS 312 Assignment 5 LinkedList Object

Write a program that inserts 25 random integers from 0 to 100 in order into Java’s LinkedList object (you must use Java’s LinkedList class to get any credit for this assignment).

 

The program must:

 

sort the elements,

then calculate the sum of the elements, and

calculate the floating-point average of the elements.

 

For this assignments make sure that your screen shot(s) show your program running and that your runtime display shows your random list, sorted list, sum of the elements, and average of the elements.  You only get credit for what you demonstrate.  Below is a sample screen shot.  Your output doesn’t have to look exactly like this but you should display the unsorted list, the sorted list, the sum, and the average to get full credit.

 

 

 

 

 

CSIS312 Assignment 5

You May Also Like:

CSIS 312 Assignment 1 Time2 Class

CSIS 312 Entire Course

CSIS 312 Assignment 2 Employee Class

CSIS 312 Assignment 3 Payroll System

CSIS 312 Assignment 4 Random Sentences

CSIS 312 Assignment 6 printArray and Factorial Calculator

CSIS 312 Assignment 7 Pair Class

CSIS 312 Assignment 8 Stack Data Structure

CSIS 312 Assignment 6 Print Array

CSIS 312 Assignment 8 SecureRandom

 

 

CSIS 312 Assignment 4 Random Sentences

We now discuss the features of class StringBuilder for creating and manipulating dynamic string information—that is, modifiable strings. Every StringBuilder is capable of storing a number of characters specified by its capacity. If a StringBuilder’s capacity is exceeded, the capacity expands to accommodate the additional characters.

 

In programs that frequently perform string concatenation, or other string modifications, it’s often more efficient to implement the modifications with class StringBuilder rather than String.

 

Instructions

 

Write an application that uses random-number generation to create sentences. Create four String arrays called article, noun, verb, and preposition containing the following words:

 

The article array must contain the articles “the,” “a,” “one,” “some,” and “any.”

The noun array must contain the nouns “boy,” “girl,” “dog,” “town,” and “car.”

The verb array must contain the verbs “drove,” “jumped,” “ran,” “walked,” and “skipped.”

The preposition array must contain the prepositions “to,” “from,” “over,” “under” and “on.”

 

Create a sentence (using the StringBuilder type) by selecting a word at random from each array in the following order:

 

Article,

noun,

verb,

preposition,

article, and

 

As each word is picked, concatenate it to the previous words in the sentence using the StringBuilder append() method. The words must be separated by spaces. When each sentence is output, the first letter of the first word should start with a capital letter and the sentence should end with a period (see sample output below). The application must generate and display 20 sentences.

 

 

 

 

 

You May Also Like:

CSIS 312 Assignment 1 Time2 Class

CSIS 312 Entire Course

CSIS 312 Assignment 2 Employee Class

CSIS 312 Assignment 3 Payroll System

CSIS 312 Assignment 5 LinkedList Object

CSIS 312 Assignment 6 printArray and Factorial Calculator

CSIS 312 Assignment 7 Pair Class

CSIS 312 Assignment 8 Stack Data Structure

CSIS 312 Assignment 6 Print Array

CSIS 312 Assignment 8 SecureRandom

 

 

CSIS 312 Assignment 3 Payroll System

Modify the payroll system of Figs. 10.4–10.9 to include an additional Employee subclass PieceWorker that represents an employee whose pay is based on the number of pieces of merchandise produced.

 

Class PieceWorker should contain private instance variables wage (to store the employee’s wage per piece) and pieces (to store the number of pieces produced).

 

Provide a concrete implementation of method earnings in class PieceWorker that calculates the employee’s earnings by multiplying the number of pieces produced by the wage per piece.

 

Create an array of Employee variables to store references to objects of each concrete class in the new Employee hierarchy (SalariedEmployee, CommissionEmployee, HourlyEmployee, BasePlusCommissionEmployee, and now PieceWorker).

 

For each Employee, display its String representation and earnings.

 

Submit this assignment by 11:59 p.m. (ET) on Monday of Module/Week 3.

 

 

 

 

 

CSIS312 – ADVANCED OBJECT-ORIENTED PROGRAMMING Assignment 3

You May Also Like:

CSIS 312 Assignment 1 Time2 Class

CSIS 312 Entire Course

CSIS 312 Assignment 2 Employee Class

CSIS 312 Assignment 4 Random Sentences

CSIS 312 Assignment 5 LinkedList Object

CSIS 312 Assignment 6 printArray and Factorial Calculator

CSIS 312 Assignment 7 Pair Class

CSIS 312 Assignment 8 Stack Data Structure

CSIS 312 Assignment 6 Print Array

CSIS 312 Assignment 8 SecureRandom

 

 

CSIS 312 Assignment 2 Employee Class

In chapter 9 of your Deitel & Deitel text, you studied an inheritance hierarchy in which class BasePlusCommissionEmployee inherited from class CommissionEmployee. However, not all types of employees are CommissionEmployees.

 

In this exercise, you’ll create a more general Employee superclass that factors out the attributes and behaviors in class CommissionEmployee that are common to all Employees. The common attributes and behaviors for all Employees are firstName, lastName, socialSecurityNumber, getFirstName, getLastName, getSocialSecurityNumber and a portion of method toString.

 

Create a new superclass Employee that contains these instance variables and methods and a constructor.

 

Next, rewrite class CommissionEmployee from Section 9.4.5 as a subclass of Employee. Class CommissionEmployee should contain only the instance variables and methods that are not declared in superclass Employee. Class CommissionEmployee’s constructor should invoke class Employee’s constructor and CommissionEmployee’s toString method should invoke Employee’s toString method.

 

Once you’ve completed these modifications, run the BasePlusCommissionEmployeeTest app using these new classes to ensure that the app still displays the same results for a BasePlusCommissionEmployee object.

 

Make sure that your screen shots show your program running and that your runtime display shows that your program does all that is required of it. You only get credit for what you demonstrate.

 

Submit this assignment by 11:59 p.m. (ET) on Monday of Module/Week 2.

 

 

 

 

 

 

CSIS 312 Assignment 2 Screenshot

You May Also Like:

CSIS 312 Assignment 1 Time2 Class

CSIS 312 Entire Course

CSIS 312 Assignment 3 Payroll System

CSIS 312 Assignment 4 Random Sentences

CSIS 312 Assignment 5 LinkedList Object

CSIS 312 Assignment 6 printArray and Factorial Calculator

CSIS 312 Assignment 7 Pair Class

CSIS 312 Assignment 8 Stack Data Structure

CSIS 312 Assignment 6 Print Array

CSIS 312 Assignment 8 SecureRandom

 

 

CSIS 312 Assignment 1 Time2 Class

Using the Time2.java and Time2Test.java files provided, it would be perfectly possible to represent the time internally as the total number of seconds since midnight rather than with the three integer values hour, minute, and second. Clients could use the same public methods and get the same results. Modify the Time2 class so that time is represented internally as seconds by replacing the instance variables hour, minute, and second with a single instance variable called totalSeconds, and then use Time2Test.java to test your modified Time2 class.  If your implementation is correct, the output of Time2Test should be the same as it was before you made any changes to Time2.

 

Note that the three argument constructor calls setTime() which then calls the setters and thereby demonstrates, whenever the three argument constructor is called, that the setters all work.  Your solution should focus on changing setters and getters and should continue using them to get full credit for your work.

 

Be sure you read the lab submittal instructions to submit your lab properly.  If you don’t submit your lab properly you won’t get any credit for your work and you will not be allowed to resubmit your assignment.

 

Submit this assignment by 11:59 p.m. (ET) on Monday of Module/Week 1.

 

 

 

 

 

CSIS 312 Assignment 1 Screenshot

You May Also Like:

CSIS 312 Entire Course

CSIS 312 Assignment 2 Employee Class

CSIS 312 Assignment 3 Payroll System

CSIS 312 Assignment 4 Random Sentences

CSIS 312 Assignment 5 LinkedList Object

CSIS 312 Assignment 7 Pair Class

CSIS 312 Assignment 6 Print Array

CSIS 312 Assignment 8 SecureRandom

Made with care

Great value

Elegant design

Quality materials

Details

This product is crafted with quality materials to ensure durability and performance. Designed with your convenience in mind, it seamlessly fits into your everyday life.

Shipping & Returns

We strive to process and ship all orders in a timely manner, working diligently to ensure that your items are on their way to you as soon as possible.

We are committed to ensuring a positive shopping experience for all our customers. If for any reason you wish to return an item, we invite you to reach out to our team for assistance, and we will evaluate every return request with care and consideration.

Play video