Question: 1. Finding future day of the week. Write a program in Java that prompts a user to enter an integer for today's day of the

1. Finding future day of the week. Write a program in Java that prompts a user to enter an integer for today's day of the week (0 for Sunday, 1 for Monday, ... 6 for Saturday). Next prompt the user for the number of days after today then calulate and display today's and that future day of the week.

Example: Enter today's day: 1 Enter the number of days elapsed since today: 3 Today is Monday and the future day is Thursday Example: Enter today's day: 0 Enter the number of days elapsed since today: 31 Today is Sunday and the future day is Wednesday Hint: the modulus operator is ofter useful in clock and calendar problems where things keep reoccuring.

2. Imagine a right tringle with points (x, y) at (0,0), (0,100) and (200,0) Hint: The equation for the top of the triangle can be found using y = mx + b, where m is the slope of the line and b is the y-intercept: y = -0.5 * x + 100 Using Java, Prompt a user for a point at arbitrary X and Y coordinates. Does the point lie within the imagined triangle? Example: Enter x and y for a point: 100.5 20.5 The point is within the triangle. Example: Enter x and y for a point: 100.5 70.5 The point is not within the triangle.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!