Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Above is the problem that I have. Below is the code I've already done but I'm stuck. #include using namespace std; enum months { Tes,

image text in transcribed

Above is the problem that I have. Below is the code I've already done but I'm stuck.

#include

using namespace std;

enum months { Tes, Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec };

struct time { int days; int years; months m; //formating needs to be done };

int main() {

struct time d;

int temp = 0;

cout > temp;

cout

cin >> d.days; cout

cin >> d.years;

if (temp == 1) { d.m = Jan; }

if (temp == 2) { d.m = Feb; }

if (temp == 3) { d.m = Mar; }

if (temp == 4) { d.m = Apr; }

if (temp == 5) { d.m = May; }

if (temp == 6) { d.m = Jun; }

if (temp == 7) { d.m = Jul; }

if (temp == 8) { d.m = Aug; }

if (temp == 9) { d.m = Sep; }

if (temp == 10) { d.m = Oct; }

if (temp == 11) { d.m = Nov; }

if (temp == 12) { d.m = Dec; }

if (d.days >= 32) {

cout

} }

You'll be taking input from the user for a day, month, and year. The month will be in an enum while the day and year will be integers. You'll need to create a struct that houses the 3 datas and a function that can validate if it is a real date using the struct type you create as a parameter. You'll need another function to print out the date into a nice format (can be any, just make it pretty) that also uses the struct type you created as a parameter

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Oracle 11G SQL

Authors: Joan Casteel

2nd Edition

1133947360, 978-1133947363

More Books

Students also viewed these Databases questions

Question

Queues can help to equitably reduce moral hazard.

Answered: 1 week ago