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());
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?
|