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

State about the performance of java, State about the performance of java ...

State about the performance of java First versions of java were pretty slow. Java performance has gotten a lot better with aggressive just-in-time-compiler (JIT) techniques

Program to calculates the number of unique shapes, 1. Write the code for th...

1. Write the code for the method that calculates the number of unique shapes for a binary search tree with n nodes. Use the formula  where b n is the number of possible sh

Smugglers decodes , Smugglers are becoming very smart day by day. Now they ...

Smugglers are becoming very smart day by day. Now they have developed a new technique of sending their messages from one smuggler to another. In their new technology, they are send

Package diagrams , To simplify complex class diagrams you may group classes...

To simplify complex class diagrams you may group classes into packages.

Write a java code to explain else if, Write a java code to explain Else If ...

Write a java code to explain Else If ? if statements are not limited to two cases. You can merge an else and an if to form an else if and test a overall range of mutually exclu

Socket in java networking and rmi, What Is a Socket in Java Networking and ...

What Is a Socket in Java Networking and RMI? Ans) A socket is one end-point of a two-way communication link among two programs running on the network. A socket is bound to a por

Write a algoritm to play blackjack , Draw: loops through the list of cards ...

Draw: loops through the list of cards drawing them in a single row starting from the screen position referred to by the 'x' and 'y' fields of the Hand class. You can limit the numb

Eclipse javaj, how to write coding for money and currency

how to write coding for money and currency

Explain the importance of abstract classes in java, Question: (a) Expl...

Question: (a) Explain the importance of abstract classes in Java with an appropriate example. (b) Explain what is meant by an interface in Java? Use a simple example to il

Javascript to calculate the cost of each book, Write JavaScript code that i...

Write JavaScript code that is executed during form submission to calculate the cost of each book (based on quantity specified) and the overall total cost. The results should be dis

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