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

Bi-lingual site for the mitzpe apiary, Bi-lingual site for the Mitzpe apiar...

Bi-lingual site for the Mitzpe apiary Project Description: We require a bi-lingual website built in 14 days. The Mitzpe Apiary is a new company that was started by local e

Programing, A servey is done in M.P. by forest department finding different...

A servey is done in M.P. by forest department finding different types of species of birds the servey data covered four major cities indore,Bhopal,Gwalior,vidhisa. The result they o

What is runnable jar archives, What is Runnable JAR archives You can ru...

What is Runnable JAR archives You can run a program stored within the JAR archive that has a main() method like this: $ java -cp eharold.jar MainClassName You must use the f

Explain the relational operator precedence, Explain the Relational Operator...

Explain the Relational Operator Precedence ? Whenever a new operator is introduced you have to ask yourself whereas it fits in the precedence tree. If you seem back at the ins

Explain init(), Explain init(), start(), stop(), and destroy() method? ...

Explain init(), start(), stop(), and destroy() method? The init() method is known as exactly once in an applet's life, while the applet is first loaded. It's generally used to

Jsp retrive data, how to retrive data in one block from database by click ...

how to retrive data in one block from database by click data link in another block

Draw a use case diagram in uml, Extend the given drawing program (the versi...

Extend the given drawing program (the version that allows undo and redo) as follows: a) Allow the user to select font and font size; user should also be able to boldface, underl

Print the percentage of each nucleotide, 1. In this lab assignment we will ...

1. In this lab assignment we will be using the vim or emacs editor in addition to the commands we have already learned. Open a shell terminal and create a file named in your home d

What is jms client, An application or procedure that produces and/or receiv...

An application or procedure that produces and/or receives messages.

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