Write a program that accepts a date from the user

Assignment Help Electrical Engineering
Reference no: EM13279618

Write a program that accepts a date from the user in the form mm/dd/yyyy and then displays it in the form month dd, yyyy, where month is the written name of the month. Store the month names in an array that contains pointers to strings. You must not allow a user to enter an invalid date. Keep asking until they make a valid entry. You should make the calculation to determine if the user has entered a valid year when they enter February 29. Leap years occur during the years that are evenly divisible by four. Also, years that are divisible by 100 are not leap years, unless they are also divisible by 400. Future dates are acceptable. Two example runs are shown below. User input is underlined.

Enter a date (mm/dd/yyyy): 2/17/2021
You entered the date February 17, 2021.

Enter a date (mm/dd/yyyy): 2/32/2022
You entered an invalid date; please try again.
Enter a date (mm/dd/yyyy): 2/22/2022
You entered the date February 22, 2022.

Reference no: EM13279618

Questions Cloud

Design a combinational circuit that detects an error : Design a combinational circuit that detects an error in the representation of decimal digit in Excess-3. The output of the circuit must be equal to logic-1 when the inputs contain any one of the six invalid Excess-3 codes.
What is nominal interest rate on a four-year u.s. government : The default premium is 1 percent. The maturity risk premium on four year bonds is 0.50%. What is the nominal interest rate on a four-year U.S. government bond?
What are the four speeds available for each resistor : A 1/10hp motor has a 1000 rpms with 20v across the armature and series winding there are three speed control switches. The motor speed decreases linearly what are the four speeds available if each resistor is .54 ohms.
What is the sustainable rate of growth : The Green Giant Has a 5 perecnt profit margin and a 40 percent dividend payout ration the total assest turnover is 1.40 and the equilty militiplier is 1.50. What is the sustainable rate of growth?
Write a program that accepts a date from the user : Write a program that accepts a date from the user in the form mm/dd/yyyy and then displays it in the form month dd, yyyy, where month is the written name of the month. Store the month names in an array that contains pointers to strings.
What must the coupon rate be on the bonds : Osbourne Corporation has bonds on the market with 16.0 years to maturity, a YTM of 10.5 percent, and a current price of $943. The bonds make semiannual payments. What must the coupon rate be on the bonds?
What is the final temperature of the water cup and bear : You drop a 297-g silver figure of a polar bear into the 203-g aluminum cup of a well-insulated calorimeter containing 257 g of liquid water at 21.7°C. What is the final temperature of the water, cup, and bear
Calculate the best-case and worst-case npv figures : Calculate the best-case and worst-case NPV figures. (Negative amounts should be indicated by a minus sign. Do not round intermediate calculations and round your final answers to 2 decimal places. (e.g., 32.16))
Find magnetic field intensity at origin use magnetic field : A constant current I is flowing in a semi infinite loop. Find magnetic field intensity at the origin: H(0,0,0). Use magnetic field intenisty for a piece of wire.

Reviews

Write a Review

Electrical Engineering Questions & Answers

  How much time passes before the players collide

Two soccer players start from rest, 34 m apart. They run directly toward each other, both players accelerating. The first player's acceleration has a magnitude of 0.42 m/s2. The second player's acceleration has a magnitude of 0.41 m/s2.

  What is the maximum power that can be delivered to the load

The battery is made by connecting 7 unit cells in series and then by connecting 5 of these series cells in parallel. Each unit cell has the voltage of 1.25 V and the internal resistance if 3.2 Ohm. What is the maximum power that can be delivered t..

  Evaluate cross or auto correlation

You have to figure out which one using cross or auto correlation.

  Calculate ni and the concentration of electrons

an unknown semiconductor has Eg=1.1ev and Nv=Nc.it is doped with 10^15 donors,where the donor level is 0.2ev below Ec. given that Ef is 0.25ev below Ec, calculate ni and the concentration of electrons and holes in the semiconductor at 300k.

  Find the input power to the generator in horsepower nd watts

A 500-kVA, 60Hz, 5000V, Y-connected, 10 pole synchronous has internal parameters of Armature Resistance 1ohm amd Synchronous Reactance 10ohms. The generator is operating at rated values and 0.9 pf leading.

  Determine what are the number of lamps required

an office with several work stations has an effective area of 527 sqft (49 meters). it has decorative incandescent lighting. The lamps are 40 watt yielding an out put of 18 lm/W. An illumination of 645 lux is required for the work stations.

  Determine the noise on the output as percent fs

A system is needed to measure flow, which continuously cycles between 20 and 30 gal/min with a period of 30 sec. The required output is a voltage varying from -2.5 to +2.5 V for the cycling flow range. The sensor to be used has a transfer function..

  Find the p-n junction led current with doping

An Al0.3Ga0.7As p-n junction LED with doping level ND = 1 x 10^18 cm-3 on n-side and NA=1x10^15 cm-3 on p-side has Vf = 0.9 V forward bias across its junction. The LED cross-section is 200 µm x 200 µm.

  Determine what velocity is attained by the charge

if the energy strored in the fully charged battery is used to lift the battery with 100% efficiency, what height is attained. Assume that the acceleration due to gravity is 9.8 m/s^(2) and is constant with height.

  What is the output error voltage of differential amp

the diff amp pf has Av= 360 lin(bias)=600nA,lin(off) =100nA and Vin(off)=1mV. what is the output error voltage if a matching base resistor is used, what is the output error voltage

  Determine what is the terminating load impedance

Use Smith Chart: A 100 Ohm air-coaxial transmission line is measured to have an input impedance of 100 + j100 Ohms. If the system is operated at 100 MHz and is one meter long, what is the terminating load impedance

  What is the sampling period and the bit time

2. What is the sampling period 3. What is the bit time 4. What is the bit rate of that system 5. What is the time allotted to each channel

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd