sree java

Greenhorn
+ Follow
since Dec 10, 2012
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
1
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by sree java

Write a small java program that will store mobile subscribers in memory and allow a few operations on the subscribers. Each subscriber consists of a phone number, name, balance in cents, and decrement rate. A decrement rate is a number which indicates how many cents a subscriber is charged per minute. A phone number is a 10 digit number. In addition to the operations below, there should also be seperate thread running that prints the phone number and name of all the currently stored subscribers to standard out every minute.
The following operations should be supported:
1. Adding a new Subscriber:
a. This operation should accept all the attributes of a subscriber.
b. This operation should create the subscriber and save it.
c. This operation should fail with error code 100 and error message “Invalid subscriber definition!” if the phone number is not valid.
d. This operation should fail with error code 400 and error message “Subscriber already exists!” if the phone number corresponds to an existing subscriber.

2. Retrieving an existing Subscriber:
a. This operation should accept a phone number and return the associated subscriber.
b. This operation should fail with error code 200 and error message “Subscriber does not exist!” if the phone number does not correspond to an existing subscriber.

3. Removing an existing Subscriber:
a. This operation should accept a phone number and remove the associated subscriber.
b. This operation should fail with error code 200 and error message “Subscriber does not exist!” if the phone number does not correspond to an existing subscriber.

4. Update an existing Subscriber’s balance:
a. This operation should accept a phone number and an increment amount.
b. This operation should adjust the subscriber’s balance with the given amount.
c. This operation should fail with error code 200 and error message “Subscriber does not exist!” if the phone number does not correspond to an existing subscriber.
d. This operation should fail with error code 300 and error message “Balance is out of range!” if the new balance is less than $0 or more $1000.

5. Retrieve an existing Subscriber’s balance:
a. This operation should accept a phone number.
b. This operation should return both the subscriber’s balance in cents and how many minutes the subscriber can use before his balance is expired.
c. This operation should fail with error code 200 and error message “Subscriber does not exist!” if the phone number does not correspond to an existing subscriber.


Can you please send me the elaborate solution for this assaignment. I Compiled The Above code in My Eclipse IDE, I Couldn't understand The flow, Do You have any other solution For this Assaignment?


Thanks,
Sree
7 years ago
PLEASE HELP
do you have solution for this program.if so can you please send
















C:\java\TMobile>javac -Xlint Subscriber.java
Subscriber.java:57: cannot find symbol
symbol : variable nuSubscriber
location: class Subscriber
if (!subscriberList.contains(nuSubscriber)) {
^
Subscriber.java:58: cannot find symbol
symbol : variable nuSubscriber
location: class Subscriber
subscriberList.add(nuSubscriber);
^
2 errors

C:\java\TMobile>

7 years ago