Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Java Expert


Home >> Java

Assignment

In this assignment, you are required to specify and implement a Java

The language is Java. In this assignment, you are required to specify and implement a Java class named IntSortedList. The instances of IntSortedList are sorted lists of integers. Each class in the program need a class invariant. There should be no limit on the length of the list. The operations on sorted lists of integers supported by IntSortedList are

• A default constructor that creates an empty list of integers.

• An operation named empty that determines if the sorted list is empty. The operation takes no argument and returns a Boolean value.

An operation named length that returns the number of items on the sorted list. The operation takes no argument and returns a positive integer.

• An operation named insert that inserts an integer to the sorted list while maintaining its sorted-ness. The operation takes the integer to insert as its only argument. It should always succeed.

• An operation named delete that deletes an integer from the sorted list. The operation takes the integer to delete as its only argument. It returns true if the integer was in the sorted list. Otherwise, it returns false. Only one

occurrence of the target is deleted by this operation.

• An operation named show that displays the integers in the sorted list on screen. Every row except the last one contains 8 integers separated by spaces.

The last row may contain less than 8 integers.

You are required to provide an array-based implementation of IntSortedList and write a program that makes use of IntSortedList. Follow the following steps.

1. Refine the above specification of IntSortedList by writing function prototypes for its operations and their pre/post conditions.

2. Write a class definition for IntSortedList. The only public methods in the class definition are those operations. The private members are instance variables that represent a sorted list of integers. Write an invariant on these instance variables as comments. You can have private methods that are auxiliary to public ones.

3. Write a program that reads from keyboard a sequence of positive integers that is ended with a negative integer. The positive integers are inserted into a sort list of integers when they are read. When the program finishes reading, it displays the following information on screen: (a) the number of positive integers that have been read; (b) the positive integers.

Java, Programming

  • Category:- Java
  • Reference No.:- M92078448
  • Price:- $30

Priced at Now at $30, Verified Solution

Have any Question?


Related Questions in Java

Can someone help me please with those question1what is the

Can someone help me please with those question 1:what is the best data type for student id datatime,currency,number,decimal 2:which relationshipis preferable? one to one,one to many,many to many 3:if you add table A's pr ...

Assignment - java program using array of objectsobjectives

Assignment - JAVA Program using array of objects Objectives - This assessment item relates to the course learning outcomes as stated in the Unit Profile. Details - For this assignment, you are required to develop a Menu ...

Assessment instructionsin this assessment you will design

Assessment Instructions In this assessment, you will design and code a simple Java application that defines a class, instantiate the class into a number of objects, and prints out the attributes of these objects in a spe ...

Overviewyou are required to use java se 80 and javafx to

Overview You are required to use Java SE 8.0 and JavaFX to develop a Graphical User Interface (GUI) for the FlexiRent rental property management program created in Assignment 1. This assignment is designed to help you: 1 ...

Assessment -java program using array of Assessment -JAVA Program using array of objects

Assessment -JAVA Program using array of objects Objectives This assessment item relates to the course learning outcomes as stated in the Unit Profile. Details For this assignment, you are required to develop a Windowed G ...

Object-oriented software development1 introduction 11

OBJECT-ORIENTED SOFTWARE DEVELOPMENT 1. Introduction 1.1 Assignment Requirement 1.2 Deliverables and Structure (what to submit) 1.3 Software Restrictions 1.4 How to score high... 1.5 Assumptions 2. System Requirements 2. ...

Applied software engineering assignment 1 -learning

Applied Software Engineering Assignment 1 - Learning outcomes - 1. Understand the notion of software engineering and why it is important. 2. Analyse the risk factors associated with phases of the software development lif ...

Question slideshows or carousels are very popular in

Question : Slideshows (or carousels) are very popular in websites. They allow web developers to display news or images on the website in limited space. In this code challenge, you are required to complete the JavaScript ...

Assignment game prototypeoverviewfor this assessment task

Assignment: Game Prototype Overview For this assessment task you are expected to construct a prototype level/area as a "proof of concept" for the game that you have designed in Assignment 1. The prototype should function ...

Simple order processing systemquestion given the classes

Simple Order Processing System Question: Given the classes Ship (with getter and setter), Speedboat, and SpeedboatTest. Answer the following questions: Refine the whole application (all classes) and create Abstract class ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As