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 are errors handled by the different windowing systems

How are errors handled by the different windowing systems What different types of errors can occur and how do these windowing systems handle these different types of errors.

  Compute the voltage gain assuming beta

BJT Amplifiers Sketch an emitter-follower circuit with R1 = R2 = 50kohm ; RE = 2kohm. The collector of the npn transistor is connected to VCC = 5V and the input signal has an internal resistance, RS = 0.5kohm

  Write a matlab function to generate gray coding matrix

Write a matlab function to generate Gray coding matrix. The function has one input M where M=2^m and m is the number of bits per symbol. For example, if the function my_graycoding(4), the output should be

  Caculate how long does it take to boil a cup of water

A device for heating a cup of water in a car connects to the car's battery, which has an emf EMF = 10.0 V and an internal resistance r_int = 0.08 \Omega. The heating element that is immersed in the cup of water is a resistive coil with resistance ..

  Draw circuit that will have underdamped transient response

Given a course voltage of 10V, a source resistance of 10 ohms, a 10mH inductor, and a 5nF capacitor, choose a load resistance and draw a circuit that will have an underdamped (decaying sine wave) second order transient response.

  Determine the frequency that sampling system will generate

A system samples a sinusoid of frequency 850 Hz at a rate of 250 Hz and writes the sampled signal to its output without further modification. Determine the frequency that the sampling system will generate in its output.

  What a resource-allocation graph of the situation will show

There are two printers and two I/O ports available in a system. Process A is using an I/O port and is waiting for a printer. Process B is using a printer. Process C is using a printer and is waiting for an I/O port.

  Design a filter that satisfies the requirements of source

Design a filter that satisfies the following requirements: 1 input is a current source ranging from 4 mA to 20 mA with a source resistance of 10 ohms. 2 THe filter must output a voltage ranging from 2v to 10 v.

  Calculate power angle if network receives a capacitive power

A 150 MVA, 24 kV, 123% three-phase synchronous generator supplies a large network. The network voltage is 27 kV. The generator operates with an induced voltage, which is twice the rated line-to-neutral voltage.

  What is the minimum power rating for each resistor

The voltage across the load must remain between 4.7 and 5.0 V for all values of load current. Come up with (draw) a voltage-divider network to supply the load. You may assume that resistors of any value desired are available.

  Explain what is the chemical shift difference

From the 1H NMR perspective, the human body is composed primarily of fat hydrogens and water hydrogens (H2O). The resonance frequency difference between the NMR signal from these two types of hydrogens is approximately 220 Hz on a 1.5 Tesla imager..

  What is the total impedance of the transmission line

The impedance of the transmission line is 2+j4 mega-ohms per kilometer. What is the total impedance of the transmission line. The solutions manual of my book has the impedance of the transmission line being 0.2+0.4j.

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