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

  Java program to find a value at in index

Construct a main class named Array Program that generates an array of 50-integers, all ranging from one to one hundred.

  Create the class airplane

Your missions is to create the class Airplane. Each Airplane object should store the following information (fields):

  Implement a shopping cart class with user interface

project will be to implement a shopping cart class with user interface (UI) that contains main() in Net Beans. The UI class will be used to perform user input/output and to invoke the appropriate methods of shopping cart class. When your program star..

  Write method called median that accepts an array of integer

Write a method called median that accepts an array of integers as its parameter and returns the median of the numbers in the array.

  Write a program that reads a list of real numbers.

Write a program that reads a list of real numbers. After the program ends it should print out only the unique numbers

  An infix to postfix method for my java program.

an infixToPostFix method for my java program. The method must work with stacks and it should take a string as parameter. The method should be able to convert to postfix mathematic expressions such as: (12 + 4) - 23(9-6)/12. Treat the parenthesis as l..

  Write java program to utilizes gui with five text fields

Write down the program called MaxMinAvgGUI.java which utilizes GUI with five(5)text fields which asks user to enter 5(five) decimal numbers. 1(one)number in each text field.

  Can linear search algorithm be encoded using recursion

Determine the average amount of time people spend waiting for tables and provide examples from the "real world" of unsorted lists, sorted lists, indexed lists, lists that permit duplicate elements, and lists that do not permit duplicate elements

  Constructor that accepts a file name as its argument

Write a class with a constructor that accepts a file name as its argument. Assume the file contains a series of numbers, each written on a separate line. The class should read the contents of the file into an array, and then displays the following..

  Method named isallvowels that returns

Write a method named isAllVowels that returns whether a String consists entirely of vowels (a, e, i, o, or u, case-insensitively). If every character of the String is a vowel, your method should return true. If any character of the String is a non-vo..

  Write program in java for total amount of customer-s order

Write down program in Java which would ask for clerk to enter total amount of customer's order. Program will then compute seven percent (7%) sales tax.

  Write java program using array list object

Write a java program (using eclipse) using ArrayList object to allow the professor to enter student's name, his or her's four test scores.

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