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

  Display a welcome message to your user

Write a one screen description of your initial reactions to Java. Reactions may be both positive and negative. At the end of this module you will be asked to write a reply to these initial reactions.

  Java program the program has a page that shows the users

java program the program has a page that shows the users name and program name. a second jpanel that shows 4 buttons

  Java program for real estate agent

Write down java program for real estate agent. Program must perform the following tasks: ask users for average house price for the each of past 5 years for single family residence of 1500 square feet.

  Using a linked implementation of graph write a method

Write a method that takes two nodes as input and returns true if joining an edge between these two nodes, forms a duplicate path to one of the input nodes within the graph.

  How to add a static data member

Create one project for each problem; add comments to your code -  write a program which Add a static data member to count the number of objects will be created.

  Distance traveled modification

Distance Traveled Modification

  Achieving simplicity and merely being simplistic

What is the difference between achieving simplicity and merely being simplistic?

  Java program for line item application

This exercise explains you the process of testing and enhancing Line Item application. Open LineItemApp, Validator, Product, LineItem, and ProductDB classes that are in the c:java1.6ch06LineItem directory and review this code.

  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.

  Process of buying a soda from a soda machine

Please write a Java Program those steps through the process of buying a soda from a Soda Machine.  You must interact with the consumer. Each Soda is one dollar.

  Need the build function.use recursion

Implement remaining function. Everything else is provided. Use given material to receive points. Implement remaining function. Everything else is provided. Use given material to receive points. Implement remaining function. Everything else is provide..

  Carry out additions and subtraction

You are to design a Java application to carry out additions and subtractions for numbers of any length. A number is represented as an object which includes a sign and two strings for the whole and decimal parts of the number.

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