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

  Implement a third component of the compiler

To detect duplicate declarations using the same identifier, you call the method retrieveOneLevel. This method returns a pointer to the identifier entry if the identifier was declared before in the current scope and null otherwise.

  Menu based program to maintain student records

Write a menu based program to maintain student records. Your program should take the following inputs: 1. Student first name (max. 20 characters) 2. Student last name, (max. 20 characters) 3. Student scores (float/double), eg. 85.4 Problem

  Assignment 1java tic-tac-toe game assignment 1 is

assignment 1java tic-tac-toe game assignment 1 is attachedattachment-nbsptic tac toe game.docxthis assignment consists

  Write a recursive program

Write a recursive program to compute the number of ways in which an integer k can be written as sum

  Develop a graphical user interface

For this assignment, you are required to develop a Graphical User Interface (GUI) Java Program to demonstrate you can use Java constructs including input/output via a GUI.

  What is the minimal total weight of cylinders

A scuba diver uses a special equipment for diving. He has a cylinder with two containers: one with oxygen and the other with nitrogen. Depending on the time he wants to stay under water and the depth of diving the scuba diver needs various amount of ..

  Implement all the methods in each of the classes

You need to have an array for this database, the size of this database is given by MAX. You may simply set MAX to be 8 to save your effort in filling information.

  Write java program to store values retrieved from user-array

Write a Java program named Arrays6_2GF.java Use an array to store values retrieved from user input. The number of integers to be entered (the length of the array )should also be retrieved through user input.

  Write a program called drawing in the form of a public class

Write a program called Drawing in the form of a public class Drawing that extends a Java JFrame and provides the following features.

  Display at least the waiting at each floor

From the 1st floor, the elevator can only go in one direction - up. And from the 12th floor the elevator can only go in one direction - down.

  Implement/update specific methods for the dfs of a graph

implement/update specific methods for the DFS of a graph; for at least 2 graphs (1 being the provided one), show the DFS order of vertices in the graph, and for each node,

  Consider a class that could be used to play a game of

consider a class that could be used to play a game of hangman. the class has the following attributesthe secret wordthe

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