java, JAVA Programming

Assignment Help:
1. Which of the following are not valid Java identifiers, and why?

(a) wolVes

(b) United(there is only one)

(c) 87

(d) 5 3

(e) Real ale

(f) isFound?by

2. A class Television has the following fields:

private TelevisionManufacturer supplier;

private String code

private int screenSize; // in inches

private String type; // e.g. plasma screen

Assume that the class TelevisionManufacturer is available and that this class contains an equals method.

(a) Define a class variable, totalTVs, whose purpose is to keep track of the total number of Television objects constructed during execution of a program that uses the Television class.

(b) Declare a default constructor for this class.

(c) Declare a constructor for this class which has a formal parameter corresponding to each field.

(d) Declare an accessor method called getScreenSize whose purpose is to return the value of the screenSize field of this Television.

(e) Declare a mutator method that sets the type of this Television to a given value.

(f) Declare a method to determine whether or not this Television has been supplied by a given manufacturer.

1. An electronics company needs to implement a simple stock control system. You are required to write a Java application which contains a class called StockItem together with a main method class called StockDemo. Information for each type of stock item consists of:

inventory identifier (e.g. A654Y);

quantity in stock (e.g. 350);

demand rate (quantity removed from stock each working day, assumed constant, e.g. 50);

re-order quantity (the size of an ordered batch of items, assumed constant, e.g 1000);

lead-time (number of working days delay between placing and receiving an order for a batch, e.g. 5).

The class StockItem should include fields for each of the above data items and should also include each of the following:

a default constructor that sets all fields to null or zero as appropriate;

a constructor with arguments for all fields;

set methods for all fields;

accessor methods for each of the fields;

a method to update the stock quantity when a batch is received;

a method called isReOrderPoint( ) that returns true if a batch needs to be re-ordered for this stock item and false otherwise;

a toString method that returns a description of this StockItem.

Add Java statements to your main method to thoroughly test your class. question #Minimum 100 words accepted#

Related Discussions:- java

Assignments, Define a function that will take a box type of object as argum...

Define a function that will take a box type of object as argument and return a box object whose dimension is 10 times more than the object

What is an aspect, An aspect is the cross-cutting functionality that you ar...

An aspect is the cross-cutting functionality that you are executing. It is the aspect of your application you are modularizing. An example of an aspect is logging. Logging is somet

Explain different way of using thread, Explain different way of using threa...

Explain different way of using thread? The thread could be executed by using runnable interface or by inheriting from the Thread class. The former is more advantageous, 'cau

How many kinds of errors can be found during a program, How many kinds of e...

How many kinds of errors can be found during a program development? List them. 1. Syntax errors 2. Semantic errors 3. Run-time errors

Rebuilding a server environment, Project Description: We prepare and ope...

Project Description: We prepare and operate smartphone application.(Picture sharing and social networking) But there are problems in server side. It's very slow. So we

Explain any five buzz words in java, Question 1 Explain any five buzz word...

Question 1 Explain any five buzz words in Java Question 2 Explain exception classes and also explain common exceptions in java Question 3 Explain primitive and abstract data t

Algorithm, write algorithm to perform the following operations on it create...

write algorithm to perform the following operations on it create,insertion,deletion,for testing overflow and empty conditions.

What are the basic different types of enterprise beans, Session Bean : is ...

Session Bean : is a non-persistent object that provides some business logic running on the server. Session beans do not provide system break down. There are two kinds of session b

Minimum Passing Credential, Alia is appearing for the board exams. In order...

Alia is appearing for the board exams. In order to qualify for the next class Alia need to get exactly X credits. In current semester Alia has to study N number of subjects, and ev

Write Your Message!

Captcha
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