Create a program that displays the number of days in a month

Assignment Help C/C++ Programming
Reference no: EM13166634

Create a program that displays the number of days in a month. Use a 12-element one-dimensional array to store the number of days in each month (use 28 for the number of days in February). Code the program so that it displays the number of days in the month corresponding to the number entered by the user. For example, when the user enters the number 1, the program displays "There are 31 days in the month of January". The program should display an error message if the user enters an invalid number. Put a loop in the program so that the user can input multiple months. Use a sentinel of -1 to exit the program. 

Reference no: EM13166634

Questions Cloud

State what mass of cu is electroplated by running : What mass of Cu is electroplated by running 13.0 A of current through a Cu^2 solution for 4.00 h? Express your answer to three significant figures and include the appropriate units.
How many kg of water were in the sample : A 95.0 gram piece of ice at 0.0 degrees celcius is added to a sample of water at 8.0 degrees celcius. All of the ice melts and the temperature of the water decreases to 0.0 degrees celcius. How many Kg of water were in the sample?
The excavated material is to be hauled : The excavated material is to be hauled away and used as compacted fill material on another site adjacent to the current site. Assuming that a soil analysis shows that the soil weighs 2,800 lbs/ cubic yards (CY), 2,000 lbs/CY, and 3,500 lbs/CY in i..
Capital investment prior to any remaining income : In addition, Moss and Kim have suggested that the operating agreement be written so that all matters are settled by majority vote, with each partner having a one-third voting interest in the LLC and if you were providing Kelly Herron counsel, what..
Create a program that displays the number of days in a month : Create a program that displays the number of days in a month. Use a 12-element one-dimensional array to store the number of days in each month (use 28 for the number of days in February).
Outline two different methods that could be used to prepare : Outline two different methods that could be used to prepare 2-methyl-2-butanol using a Grignard synthesis. Which method is the best? Explain
What would be the new temperature of the water : If you used 8400 kilojoules you expend in energy in one day to heat 50,000 g of water to 20 degrees C, what would be the irse in temperature? What would be the new temperature of the water?
Oracle datatypes for the attributes : Choose Oracle datatypes for the following attributes from a normalized relation including:
What is the density of talc : Talc is a mineral that has low conductivity for heat and electricity and that is not attacked by acid. It is used as talcum powder and face powder. A sample of talc weighs 35.97 g in air and 13.65 g in mineral oil (d = 1.75 g/cm3). What is the den..

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Implement the vector class using inheritance

Is it better to implement the Vector class using inheritance (is-a relationship) or composition (has-a relationship). In other word, which one of the following gives a better implementation?

  Assign passed value to function to return value

Assign passed value to this member and another function to return value. Your main should read the integer from an input data file, and write the output to the output data file.

  Create a class named gamer that has a field for name

Create a class named Gamer that has a field for name(string) and a field for points(int).

  Program to generate 100,000 prime numbers

Write a POSIX C/C++ program to generate 100,000 prime numbers. Assume that the program will be run on a computer with 5 CPUs and that your goal is to have this program finish as quickly as possible.

  Write a switch-case programming for calculation

How to use C++ to write a switch-case programming for calculation? Test the program for a wide range of possible inputs including division by zero and square root of negative values.

  Use a define statement to create a constant

Follow these specifications: Use a define statement to create a constant that will hold your student number. You should have separate string variables for your first and last name; name these first_name and last_name.

  Write a function template square()

Write a function template Square() that returns the square of its only argument.

  If ptr is a pointer to a character

If ptr is a pointer to a character and has been initialized to point to the first element of arr, write a statement using ptr that is equivalent to the statement array[4] = 12.

  Create a c++ console application

Objective: Create a C++ console application that will model the characteristics of a resistor. Create a multifile project. Create and add to the project an h file containing the resistor-class definition. Create and add to the project a cpp file cont..

  Complete the payroll program with following driver object

complete the payroll program with the following driver objects.

  A class is derived from another one

In C++, when a class is derived from another one, you can specify the inheritance relationship as public, private or even protected. What are the main differences a between these types of inheritance in C++? How does a public inheritance differ from ..

  Program to compute diameter in centimeters of a steel rod

Write a program to compute the diameter in centimeters of a steel rod, an aluminum rod, and a copper rod, which can withstand a particular compression load.

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