Write a program that prompts the user to enter a year and the first three letters of
Question:
Write a program that prompts the user to enter a year and the first three letters of a month name (with the first letter in uppercase) and displays the number of days in the month. Here is a sample run:
Transcribed Image Text:
Enter a year: 2001 Enter a month: Jan Jan 2001 has 31 days JEnter JEnter Enter a year: 2016 Enter a month: Feb Jan 2016 has 29 days JEnter JEnter
Fantastic news! We've Found the answer you've been seeking!
Step by Step Answer:
Answer rating: 70% (10 reviews)
Program Plan Create a class called DaysOfMonth Initialize the main method with variable year days as integer and month as string Create a Scanner clas...View the full answer
Answered By
PALASH JHANWAR
I am a Chartered Accountant with AIR 45 in CA - IPCC. I am a Merit Holder ( B.Com ). The following is my educational details.
PLEASE ACCESS MY RESUME FROM THE FOLLOWING LINK: https://drive.google.com/file/d/1hYR1uch-ff6MRC_cDB07K6VqY9kQ3SFL/view?usp=sharing
3.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
-
Programming Exercise 6.39 gives a method for testing whether three points are on the same line.Write the following method to test whether all the points in the array points are on the same...
-
Write a program that prompts the user to enter two strings and tests whether the second string is a substring of the first string. (Don?t use the indexOf method in the String class.) Analyze the time...
-
Write a program that prompts the user to enter the month and year and displays the number of days in the month. For example, if the user entered month 2 and year 2012, the program should display that...
-
On what date is CGT for 2020-21 normally due for payment?
-
Suppose that we have a knapsack with total capacity of W kg. We also have n items where item j has mass wj. The knapsack problem asks for a subset of these n items with the largest possible total...
-
Your local movie theater uses the same group-pricing strategy described in the chapter charge different prices for adults, children, seniors, and students. However, the theater uses one additional...
-
On October 1, 2017, Gordon borrows \($150\),000 cash from a bank by signing a three-year installment note bearing 10% interest. The note requires equal payments of \($60\),316 each year on September...
-
McDonald Company shows the following condensed income statement information for the current year: Required Calculate the degree of financialleverage. 3,500,000 (1.700,000) Revenue from sales Cost of...
-
Figure shows the spring-mass damper system of two degree of freedom with free vibrations. If m = m, m = 2.5m, c =C2=C3 = 2c, k = k, k = 2.5k and k3 = 3k. a) Draw the free body diagram & derive the...
-
A gas at upstream condition (T1 ,P1) is throttled in a downstream pressure of 1.2 bar. Use the Redlich / Kwong equation to estimate the downstream temperature and S of the gas for one of the...
-
Rewrite the Programming Exercise 3.9 by entering the ISBN number as a string. Data from Exercise 3.9 An ISBN-10 (International Standard Book Number) consists of 10 digits: d 1 d 2 d 3 d 4 d 5 d 6 d 7...
-
Write a program that displays a random uppercase letter using the Math.random() method.
-
The following cost data for the current year relate to Heartstrings Pty Ltd, a greetings card manufacturers Required: Calculate each of the following costs for the year: 1. Total prime costs. 2....
-
Create 4 caselets for 4 circumstances in QTM (M)(V)=(P)(T), I.e., (1) M- increased and decreased money supply; (2) V- increased and decreased velocity of money (circulation or the number of times...
-
Calculate the greatest diameter for 60kN punch press which is to Punch hole. Shear stress = Shear Force Shear Area Shear stress = 0.8 x tensile stress Tensile stress of St33 plate is 330 N ...
-
Identified as a "molecular machine," which organelle, situated within the cytoplasm of living cells, is responsible for synthesizing proteins from amino acids?
-
the city of Indianapolis has contracted our services to analyze the impact of a potential $15 excise tax on airbnb rentals within the city limits. through their research, the city administrators have...
-
Given information for General Motors: Cost of debt General Motors (from the footnotes to the financial statements) Beta for General Motors (from Yahoo or other financial sources) Normalized risk free...
-
Refer to the data in exercise E1-24. Prepare the statement of cash flows of the FedEx Kinko's at the University of Saskatchewan for the month ended July 31, 2017. Draw arrows linking the pertinent...
-
-4 1 9. Let A = Find A-1, (A") and verify that (A")= (A-1)".
-
Write a program that displays a cylinder, as shown in Figure 31.54b. Use dashed strokes to draw the dashed arc. I Exercise31_16 (b)
-
Write a program that displays a circle filled with a gradient color to animate a sun and display light rays coming out from the sun using dashed lines, as shown in Figure 31.54a. Evercise 1_15 (a)
-
Write a program that enables the user to scale and rotate the STOP sign, as shown in Figure 31.53. The user can press the UP/DOWN arrow key to increase/decrease the size and press the RIGHT/LEFT...
-
Assume that an economy is based on two industrial sectors, agriculture (A) and energy (E). The technology matrix M is: A E A-> 0.6 0.1 =M E-> 0.1 0.7 How much input from A and E are required to...
-
Data Analytics Problem DAPS.1 Data Analytics Wheels and Skis Inc. is a seasonal business that sells bikes and skis. Offering products for both summer and winter outdoor activities allows sales to be...
-
P/R End Date Check Date 2/10/2023 2/14/2023 Company Name: Prevosti Farms and Sugarhous Number Number of Name Filing Status Dependents Dependents Hourly Rate or Under 17 Over 17 Period Wage of Regular...
Study smarter with the SolutionInn App