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.
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
|