Write down the definitions for the member functions

Assignment Help Computer Engineering
Reference no: EM1327441

Use the following shell class SList, and complete its implementation as per the guidance in points 1 through 5. Read the documentation on the member function declarations carefully.

public class SList
{
// Methods
public void insert(int item);
// Pre: The list is not full
// item is not in the list
// Post: item is in the list; the items are in sorted order
public void printList()
// Post: If the list is not empty, the elements are
// printed on the screen; otherwise "The list
// is empty" is printed on the screen
public int getLength()
// Post: return value is the number of items in the list
public boolean isEmpty()
// Post: returns true if list is empty; false otherwise
public boolean isFull()
// Post: returns true if there is no more room in the
// list; false otherwise
SList(int maxItems)
// Constructor
// Post: Empty list is created with maxItems cells
// Data fields
private int numItems;
private int[] values;
}

1: Write the definitions for the member functions.

2: Write a driver program that reads values from file int.dat, stores them in the list, and prints them on the screen.

3: Add a boolean method "contains" to class SList that returns true if its parameter is in the list and false otherwise. Use the binary search algorithm.

4: Add a private variable currentItem to the list and implement these method headings. This combination allows the user to view the list items, one at a time.

public void resetList()
// Set currentItem to 0
public String next()
// Returns the item at values[currentItem]
// Increments currentItem
public boolean hasNext()
// Returns true if currentItem is not equal to numItems

5: Augment the driver in point 2 to demonstrate how to use resetList, hasNext, and next to print the list.

Reference no: EM1327441

Questions Cloud

Decribe the functions of a network node manager : Explain the processes that take place during network discovery and mapping.
Explain operations management- amazon : Explain Operations management- Amazon and write an executive summary on the paper and review the status of the business today
Explaining the glass ceiling affect : Provide explanation of what the glass ceiling affect is, a brief history of it and how minorities and women are affected by it with examples.
Estimating debit cost of capital : Write down the two methods for estimating debit cost of capital, and what do you do when there's default risk?
Write down the definitions for the member functions : Add a boolean process "contains" to class SList that returns true if its parameter is in the list and false otherwise. Use the binary search algorithm.
Should information on the internet be unrestricted and why : Important information about Should information on the Internet be unrestricted - Should information on the Internet be unrestricted? Why or why not?
Elucidate price every ride must the public transportation : Elucidate price every ride must the public transportation authority charge to eliminate the deficit if it cannot reduce costs
Give an example of problem versus policy issue : Give an example of problem versus policy issue. What are the strengths and constraints of evidence-based policy analysis?
Why should a business use microsoft xp pro : Why should a business use Microsoft XP pro - Advantages and disadvatages compared to the others.

Reviews

Write a Review

Computer Engineering Questions & Answers

  How to protect your network to keep data safe

describe how to protect your network to keep data safe from loss or damage.

  Deducing security policy to mitigate the threat.

Information like sales data, client data, and the network configuration. Recognize the threats these significant items are subject to and deduce the security policy in order to mitigate that threat.

  Programming field as career

Unfortunately, there are fewer women within the programming fields that there are men, encourage women to go into these fields

  Program showing duplicate values in an array

Write down a program in C in order to show the duplicate values in an array, Documentation and Naming Style Sheet should include: Description of what program does, Summary of the problem's specifications and assumptions.

  How would you assess quality of a computer program

we have developed quality factors that we look for in a software product to measure quality. These are usually done at the macroscopic level, but how would you assess quality of a computer program if you received an e-mail with a source listing of..

  Reviewing and reporting microsoft security procedures

For every operating system, review the securities procedure involving, password protection, user account setting, files and folders privacy, and the network protection (this may not be a part of the operating system)

  Explain the reason for the project development

Two members of your project development team are differing about relative significance of training and documentation.

  Factors limiting use of personalization

Two key factors limiting use of the personalization to more precisely target marketing efforts to individual customers are? Matching profiles with the product offerings and delivering those offerings.

  Creating a source documents on access 2010

Explain how to generate a source documents on the access 2010 with the information to involve the password, user ID, name, telephone, address, item number, e-mail address, bid offered, and method of payment.

  Federal rules and criminal codes

Think about computer forensics professional’s testimony preparations, and how the investigator must ensure that the federal rules and criminal codes are followed both during and after the completion of the investigation. Identify and discuss some ..

  How would this open technology benefit

The XML related technologies are growing rapidly, and it seems a definite commitment to the XML standard from many large corporations, still XML is an open standard, and promotes a culture of open source and sharing. Discuss this in relation to the..

  Implementing the java servlet

Write down the Java servlet which utilizes the doGet in order to return a markup document which provides your name, e-mail address, and mailing address along with the brief autobiography.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd