In Progress

and more simple java

Overall Requirements

Create a class named Date that stores date values and prints out the date in either a pure numeric format or a name and number format (see sample session for format details).

[url removed, login to view] class file

Date objects should store the date in two int instance variables ─ day and month, and it should include the String instance variable, error, initialized with null.

Implement a 1-parameter Date constructor that receives a dateStr string parameter and performs complete error checking on the given dateStr value. The Date constructor is the entity that’s responsible for date error checking. That way, if a Date object is instantiated and if there are no errors, then you’re guaranteed that the Date object holds a legitimate date value. If any kind of error occurs, change the value of the error instance variable to a non-null string value, using an appropriate concatenation of a string constant, input substring, and/or API exception message. In a try block, include the parsing of the month and day substrings and other error-checking logic that will not work if parsing fails.

Take into account the actual number of days in each month, but assume that there are always 28 days in February.

To extract day and month numbers from the given date string, use String’s indexOf method to find the location of the slash character, and String’s substring method to extract month and day substrings from the input string.

Include a method for printing the date with a numeric format. Use the zero-pad flag in a printf method call to get exactly two digits for each month and day.

Include a method for printing the date with an alphabetic format.

Include a getError method which returns the value of the error instance variable.

[url removed, login to view] class file

In your driver class, include a loop that repeatedly:

-Asks the user to enter a date or “q” to quit.

-If the entry is not “q”, instantiate a Date object.

-If the error variable is null:

Print the date using numeric format.

Print the date using alphabetic format.

Otherwise, print the value of the error variable.

Proper coding style is REQUIRED;

Comments are REQUIRED.

Skills: Java

See more: java print date driver, substrings, substring find, substring c, q find, parsing input, not legitimate, get substring, find substring string, find character string, extract number string, c substring, string substring, value stores, slash s, sample coding java, get java, coding java, zero day, simple api work, simple account, prints, numeric, null, java api

About the Employer:
( 6 reviews ) Monument, United States

Project ID: #557190

Awarded to:

is00hcw

Hi, I am interested in your project.

$30 USD in 0 days
(46 Reviews)
5.3

27 freelancers are bidding on average $36 for this job

ancosys

Hi, Please check pm. Thanks

$30 USD in 1 day
(47 Reviews)
5.4
Ajz

will be done immediately.

$30 USD in 0 days
(19 Reviews)
5.3
srinichal

Very simple task....would deliver under a day

$30 USD in 1 day
(17 Reviews)
5.1
justj2ee

I am interested!

$30 USD in 0 days
(21 Reviews)
4.9
kudretserin

Hi, Please see PM, Regards

$30 USD in 0 days
(54 Reviews)
4.7
rakib062

Hello sir, I have over 3 years of experience in java.I did several projects under my academic course.This is a very simple task.I hope I can do this job efficiently with better coding and documenting.Waiting for your More

$30 USD in 1 day
(11 Reviews)
3.9
MathiasDeGroof

Please sse PM

$30 USD in 2 days
(3 Reviews)
1.9
pilgrim87

Hi. I can guarantee a full commented and well-formatted code. Easier impossible. If you choose my I can start working today. Looking forward to hear from you!

$30 USD in 1 day
(1 Review)
1.4
developer84

Hi check pm please. thanks

$30 USD in 1 day
(1 Review)
1.2
prince6813

For any query just contact me on mail. I can do this for 25 dollars prince6813atgmail.com

$30 USD in 1 day
(2 Reviews)
0.8
angaratech

Its simple. I am interested. plz see PM... Regards, Angaratech

$30 USD in 1 day
(0 Reviews)
0.0
alexander79

Hello, I am Sun Certified Java Programmer with 3 years of industry experience. Your task will be done with high quality code, and with detailed comments. After that can ask any questions, if you'll need.

$30 USD in 1 day
(0 Reviews)
0.0
vijaytv198121981

will submit when you need.

$30 USD in 1 day
(0 Reviews)
0.0
pramaniksubhadip

Hi, I can do it for you at minimum cost and time. Thanks.

$30 USD in 3 days
(0 Reviews)
0.0
ksteplewski

Hello, I will write you this application quickly and at a low price, I am experienced Java programmer (simple Java stand-alone applications, JSP, Servlets, EJB and so on) and MSc in Computer Science from Technical Uni More

$30 USD in 0 days
(0 Reviews)
0.0
nawazish587

I want to take this project

$30 USD in 1 day
(0 Reviews)
0.0
realstudent

Hello. Do in one day relative to you requirements. See you.

$30 USD in 1 day
(0 Reviews)
0.0
jamesjithin

Hello, Please refer the PMB for details. I assure you 100% perfect code for less.

$30 USD in 0 days
(0 Reviews)
0.0
bindurosethomas

I am interested in your project

$75 USD in 1 day
(0 Reviews)
0.0
kumarphani

I alreday have this kind of logic.I already worked on the date utils. If needed let me know 1 day before.I will deliver it by 24 hrs. I am sun certified programmer.I am guaranteed a commented and well formatted code More

$30 USD in 1 day
(0 Reviews)
0.0