Create a program that displays the number of days

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

Program: 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.

I'm not sure how to solve the question. Can anyone help me?

Reference no: EM13738418

Questions Cloud

Divide-and-conquer two-dimensional closest-pair algorithm : Suppose the version of the divide-and-conquer two-dimensional closest-pair algorithm in which, instead of presorting input set P, we simply sort each of the two sets Pl and Pr in nondecreasing order of their y coordinates on each recursive call.
Technical meaning of conflict of interest : Question 1: The technical meaning of conflict of interest is that:
Parallel numeric arrays : Create and code a program that uses three parallel numeric arrays of size 6. The program searches one of the arrays and then displays the corresponding values from the other two arrays.
Compute the magnitude of the static frictional force : What is the magnitude of the static frictional force? Write your answer in terms of m, g, us, phi. and theta. What is the maximum angle theta such that the block won't slide.
Create a program that displays the number of days : 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
What are four examples of how direction can be used : What are four examples of how "direction" can be used in an effective publication?
Find the distance that string takes to spin the spool : Imagine that you wrap a string around a 5.0-kg spool whose radius is 5.0 cm. How long will String take to spin the spool up from rest to a rotation rate of 10 turns per second?
Design a 20-page high quality brochure : you have been hired to design a 20-page high quality brochure. Indicate the type of paper weight, opacity, brightness, and finish you would recommend for this project. Provide justification
Write a sum-of-products expression for the 8x1 multiplexer : Design a 8x1 multiplexer using seven 2x1 multiplexers. Please label all signals clearly.

Reviews

Write a Review

C/C++ Programming Questions & Answers

  The program should support a ''new'' feature

Write a GUI program that represents a simple Notepad clone. The program should support a 'new' feature that clears the text buffer, a save feature that writes to a file using a PrintStream

  Write a function num_digits(n)

C programing, not C++ write a function num_digits(n) that returns the number of digits in a nonnegative integer n.

  Generate a random number each time the operator is used

The function call operator is overloaded and will generate a random number each time the operator is used and objects can be created with the lower and upper bound of the random number specified.

  Uses the sieve of eratosthenes algorithm

Write a complete program that uses the Sieve of Eratosthenes algorithm to list all prime numbers from 1 to 1,000 .

  Write a very basic doubly-linked list

CptS 122 Lab #2: Linked Lists ,  Along with vectors, linked lists are one of the fundamental data structures in computer science. Unlike vectors, which store information in a contiguous block of computer memory, linked lists have the potential to sto..

  Program to output value of tenth component of array

Write a C++ statements to perform the following: Set value of fourth component of array alpha to three times  value of eight component minus 57.

  The program calls a function called getgrades

The program calls a function called GetGrades that will read in grades from the keyboard, the number of grades should also be input by the user.

  Write function compute square root together with prototype

Write a C++ function called compute together with its prototype that is passed 2 integers, A and B and returns the square root of A2+B2 ,as a double.

  Question 1 create an object oriented application with c

question 1 create an object oriented application with c that computes the area of a rectangle and the area and the

  . write a segment of code that prints the number of elements

Assuming the array x has been defined as: int x[n]; for some n and that values have been assigned to all the elements. Write a segment of code that prints the number of elements between (but not including) the largest and smallest values in the array..

  Lab-1the goal of this lab is to better familiarize you with

lab-1the goal of this lab is to better familiarize you with polymorphism and the factory design pattern two key

  Write a header for the function named subtract

Write a header for the function named subtract. Subtract returns nothing and has one double parameter named num.

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