Write a program that prompts the user to enter an integer for today?s day of the week
Question:
Write a program that prompts the user to enter an integer for today?s day of the week (Sunday is 0, Monday is 1, ?, and Saturday is 6). Also prompt the user to enter the number of days after today for a future day and display the future day of the week. Here is a sample run:
Transcribed Image Text:
Enter today's day: 1 JEnter Enter the number of days elapsed since today: 3 Today is Monday and the future day Enter is Thursday Enter today's day: Enter the number of days elapsed since today: 31 JEnter Today is Sunday and the future day is Wednesday -Enter
Fantastic news! We've Found the answer you've been seeking!
Step by Step Answer:
Answer rating: 66% (9 reviews)
Program Plan Prompt the user to enter todays day Prompt the user to enter the number of days elapsed ...View the full answer
Answered By
Hamza Amjad
Currently I am student in master degree program.from last two year I am tutring in Academy and I tought many O/A level student in home tution.
4.80+
3+ Reviews
10+ Question Solved
Related Book For
Introduction to Java Programming, Comprehensive Version
ISBN: 978-0133761313
10th Edition
Authors: Y. Daniel Liang
Question Posted:
Students also viewed these Computer science questions
-
Write the following method that displays the bit representation for the last byte in an integer:public static?String getBits(int?value)For a hint, see Programming Exercise 5.44. Write a program that...
-
Write a program that prompts the user to enter a letter grade A, B, C, D, or F and displays its corresponding numeric value 4, 3, 2, 1, or 0. Here is a sample run: Enter a letter grade: B The numeric...
-
Write a program that prompts the user to enter a hex digit and displays its corresponding binary number. Here is a sample run: Enter a hex digit: B JEnter The binary value is 1011 Enter a hex digit:...
-
Oil flows through the 100-mm-diameter pipe with a velocity of 5 m/s. If the pressure in the pipe at A and B is 80 kpa, determine the x and y components of force the flow exerts on the elbow. The flow...
-
Estimate the instantaneous rate of change at the point indicated. 15. f (x) = 3x ; x = 0 17. f(x) = sin x; x = / 6
-
Matthew bought 12 candy bars for $18. How many can he buy with $9?
-
Management is considering three alternatives to satisfy an urgent need. Each of the alternatives will completely satisfy the need, so no combinations have to be considered. The first costs, operating...
-
The controller of Santa Fe Housewares Inc. instructs you to prepare a monthly cash budget for the next three months. You are presented with the following budget information: The company expects to...
-
1. Using Fig 2.16 calculate S max of solar constant (irradiance) corresponding to the maximum irradiance over the 25 years presented on the graph (round your answer to 4 digits). 2. Calculate RF max...
-
Bigger n' Better Pty Ltd has just acquired the Tiny Tots business. The fair value of Tiny Tots' net assets as at the date of acquisition is $1 855 000. Bigger n' Better Pty Ltd has agreed to pay the...
-
Write a program that randomly generates an integer between 1 and 12 and displays the English month name January, February, , December for the number 1, 2, , 12, accordingly.
-
Revise Listing 3.4, ComputeAndInterpretBMI.java, to let the user enter weight, feet, and inches. For example, if a person is 5 feet and 10 inches, you will enter 5 for feet and 10 for inches. Here is...
-
What are call provisions and sinking fund provisions? Do these provisions make bonds more or less risky?
-
Suppose that you are a manager for MegaAccounting corporation, a firm specializing in accounting software. You know that you have two types of clients who use your software. Type A's inverse demand...
-
What is the total Income. ? What is per capita gain tax? Saul owns and operates a sports agency. on June 1 2022 he purchased and placed into service for his business a 900.00 desk. he would like to...
-
For safety reasons, the angle a ladder makes with the ground should be no greater than 74. Find the length to the nearest foot of the shortest ladder that will safely reach a roof that is 25 feet...
-
You plan to purchase a $1 million home in Great Falls, VA. You will make a 20% down payment, and finance the rest with an $800,000 jumbo mortgage from First National Bank of Finance. The current rate...
-
i) Suppose the market demand function in a certain market where Q is measured in thousands of units is Q d = 20 - 2.5P, and the market supply function is Q s = 2.5P - 7.5. How much deadweight loss...
-
Condensed cash flow statements are as follows for two companies operating in the same industry: Instructions Which company is in a better financial position? Explain why. Company A $200,000 (20,000)...
-
(a) Explain why the concentration of dissolved oxygen in freshwater is an important indicator of the quality of the water. (b) How is the solubility of oxygen in water affected by increasing...
-
Write a static method that draws an arrow line from a starting point to an ending point in a pane using the following method header: public static void drawArrowLine(double startX, double startY,...
-
Programming Exercise 2.17 gives a formula to compute the wind-chill temperature. The formula is valid for temperatures in the range between -58F and 41F and wind speed greater than or equal to 2....
-
Revise Listing 3.8, Lottery.java, to generate a lottery of a two-digit number. The two digits in the number are distinct. (Hint: Generate the first digit. Use a loop to continuously generate the...
-
Bramhope Manufacturing Co. Ltd has found that, after only two years of using a machine for a semi-automatic process, a more advanced model has arrived on the market. This advanced model will not only...
-
An existing mortgage with a $200,000 balance has a 5% rate and 20 years remaining. Monthly payments are $1320. A new 20-year $200,000 mortgage is offered with a 4.5% rate. There is a 1% loan...
-
Louis has an obligation to pay a sum of R7 000,00 four years from now. His creditor permits him to discharge the debt by paying R2 000,00 one year from now and a final payment of X three years from...
Study smarter with the SolutionInn App