Write a program that prompts the user for a start date

Assignment Help JAVA Programming
Reference no: EM13696432

Question: You need to write a program that prompts the user for a start date and an end date and then prints all of the dates between them (inclusive), with seven tab-separated dates on each line.

In order to do that, you need to attempt a while loop to keep going to the next date until it reaches the last one. However, had no luck?

Any hints or strategies I need to take? The code I have so far is as follows:

import stdlib.StdIn;

import stdlib.StdOut;

import algs12.Date;

public class PrintCalendar {

public static void main(String[] args){

StdOut.print("Enter a starting date: ");

String DateInput = StdIn.readLine();

Date StartingDate = new Date(DateInput);

//StdOut.print(StartingDate);

StdOut.print("Enter an ending date:" );

String DateInput2 =StdIn.readLine();

Date EndingDate = new Date(DateInput2);

while (StartingDate != EndingDate){

StartingDate.next();

}

StdOut.println(StartingDate.next());

You need to implement while loop and please keep it short and simple.

Reference no: EM13696432

Questions Cloud

How long after the first object begins : Two objects begin at different corners of an equilateral triangle with sides of length 32 m and race towards the third corner. how long after the first object begins should the second object start so that they meet at the final corner at the same tim..
Review of descriptive statistics and functions : Create a MATLAB function named "problem1", which accepts a number, a vector OR a matrix input and returns 4 outputs in this order related to the input: arithmetic average mean, standard deviation, median, max. The numbers you return for each outpu..
Define the rate of the reaction to increase or decrease : Problem- If 4-methoxybenzonitrile were used in the hydrolysis of benzonitrile instead of benzonitrile would you expect the rate of the reaction to increase or decrease. Utilize pictures and words in your analysis
What must the height of the building : A ball is thrown straight up from the edge of the roof of a building. A second ball is dropped from the roof a time of 1.20s later. What must the height of the building
Write a program that prompts the user for a start date : You need to write a program that prompts the user for a start date and an end date and then prints all of the dates between them (inclusive), with seven tab-separated dates on each line.
How long after the blue ball is thrown : A blue ball is thrown upward with an initial speed of 22.4 m/s, from a height of 0.5 meters above the ground. 2.7 seconds after the blue ball is thrown, How long after the blue ball is thrown are the two balls in the air at the same height
Calculate the cell potential for this electrochemical cell : Problem- You have constructed a quinhydrone concentration cell with buffers of pH = 5.5 and pH = 3.0 according to the following notation: C(s, graphite) | pH 5.5 buffer, quinhydrone || pH 3.0 buffer, quinhydrone | C (s, graphite). Using the Nernst..
Determine the fourth displacement : After a fourth unmeasured displacement he finds himself back where he started. Use a scale drawing to determine the fourth displacement
What is the molarity of lead ion in the original solution : Problem- If 38.5 mL of lead (II) nitrate solution reacts completely with excess sodium iodide solution to yield a 0.628 g of precipitate, what is the molarity of lead (II) ion in the original solution

Reviews

Write a Review

JAVA Programming Questions & Answers

  Recursive factorial program

Write a class Array that encapsulates an array and provides bounds-checked access. Create a recursive factorial program that prompts the user for an integer N and writes out a series of equations representing the calculation of N!.

  Hunt the wumpus game

Reprot on Hunt the Wumpus Game has Source Code listing, screen captures and UML design here and also, may include Javadoc source here.

  Create a gui interface

Create GUI Interface in java programing with these function: Sort by last name and print all employees info, Sort by job title and print all employees info, Sort by weekly salary and print all employees info, search by job title and print that emp..

  Plot pois on a graph

Write a JAVA program that would get the locations of all the POIs from the file and plot them on a map.

  Write a university grading system in java

University grading system maintains number of tables to store, retrieve and manipulate student marks. Write a JAVA program that would simulate a number of cars.

  Wolves and sheep: design a game

This project is designed a game in java. you choose whether you'd like to write a wolf or a sheep agent. Then, you are assigned to either a "sheep" or a "wolf" team.

  Build a graphical user interface for displaying the image

Build a graphical user interface for displaying the image groups (= cluster) in JMJRST. Design and implement using a Swing interface.

  Determine the day of the week for new year''s day

This assignment contains a java project. Project evaluates the day of the week for New Year's Day.

  Write a java windowed application

Write a Java windowed application to do online quiz on general knowledge and the application also displays the quiz result.

  Input pairs of natural numbers

Java program to input pairs of natural numbers.

  Create classes implement java interface

Interface that contains a generic type. Create two classes that implement this interface.

  Java class, array, link list , generic class

These 14 questions covers java class, Array, link list , generic class.

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