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

Why class can''t extend more than one class, Why is an Interface be able to...

Why is an Interface be able to extend more than one Interface but a Class can't extend more than one Class? Basically Java doesn't permit multiple inheritances, so a Class is r

Difference hashcode and equal, The hashCode() and equals() methods have...

The hashCode() and equals() methods have to be very important, when objects implementing these two functions are added to collections. If not implemented or implemented incorre

Explain the ? operator in java, Explain The ?  operator in Java ? The...

Explain The ?  operator in Java ? The value of a variable frequent depends on whether a particular boolean expression is or is not true and on nothing else. For example one ge

Problem D., In Exercise 1 you were asked to modify the Sorts program so tha...

In Exercise 1 you were asked to modify the Sorts program so that it would output the number of swaps used by a sorting method. It is a little more difficult to have the program als

Program to brute force search, Ask questionWrite a program BruteForceSearch...

Ask questionWrite a program BruteForceSearch that uses the brute-force approach given above and compare its running time on your computer with that of Binary Search for largeW.txt

Design a system program, System Program Project Description: I want s...

System Program Project Description: I want someone who can study my existing program and from there the updates may be done Skills required: Java, Oracle, MySQL, Softwa

Generating Dynamic form, I am having an combox box and values are retrieved...

I am having an combox box and values are retrieved from the database having inputs and labels i want to created the dynamic form accroding to user input on combox box values

Rmi client program, In a RMI Client Program, what are the excpetions which ...

In a RMI Client Program, what are the excpetions which may have to handled Ans) a. MalFormedURLException b. NotBoundException c. RemoteException

Test driven development (tdd)? , Test Driven Development (TDD) TDD pro...

Test Driven Development (TDD) TDD process gives your confidence in the delivered code for the following things. 1. TDD can remove duplication of code and also disciplines t

What information is needed to create a tcp socket, The Local Systems IP Add...

The Local Systems IP Address and Port Number and the Remote System's IPAddress and Port Number.

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