Write a program that prompts the user for a start date

Assignment Help JAVA Programming
Reference no: EM13168027

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, I have attempted a while loop to keep going to the next date until it reaches the last one. However, had no luck. Any hints or strageties 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());

 

 

Reference no: EM13168027

Questions Cloud

Write an algorithm that takes a sequence of real numbers : Write an algorithm that takes a sequence of real numbers s and its length n and returns the absolute value of the average of these numbers.
Contains a design with a while loop : This problem contains a design with a while loop. Assume that sum references a doubleword in the data segment and that count is in the ECX register. Give a fragment of 80x86 assembly code that implements the design.
Create a program named taxcalculation : Create a program named TaxCalculation that includes tow overloaded methods-one that accepts a price and a tax rate expressed as doubles (for example, 79.95 and 0.06, where 0.06 represents 6%),
How man moles of gas were added to the container : a gas sample containing 1.50 mol at 25 exerts a pressure of 400 torr. some gas is added to the same container and the temperature increased to 50 C. If the pressure increases to 800. torr, how man moles of gas were added to the container? assume a..
Write a program that prompts the user for a start date : 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.
Ask user to enter a list of names : Write a program that ask a user to enter a list of names. When you finish, The program will show the total number of characters in all the names.
Calculate the nuclear binding energy : Calculate the nuclear binding energy of one lithium-6 atom. The measured atomic mass of lithium-6 atom. The measured atomic mass of lithium-6 is 6.015 amu.
Calculate the mass in grams of water vapor produced : Bottled propane is used in areas away from natural gas pipelines for cooking and heating, and is also the source of heat in most gas barbecue grills. Propane burns in oxygen according to the following balanced chemical equation.
How many moles of oxygen gas are needed : if you have 4 moles of hydrogen gas, how many moles of oxygen gas are needed for complete reaction?

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