#include <iostream> #include <imanip> using namespace std; add another member me
ID: 3779596 • Letter: #
Question
#include <iostream>
#include <imanip>
using namespace std;
add another member method names convert() to this program that does the following: the method should access the month, year and data members and display and the return an integer calculated as year x month x 100 + day. include the modified date class constructed in a complete c++ program.
6 cpp (chapter 10 #6] Code: Blocks 16.01 File Edit View Search Project Build Debug Fort n wSmith Tool Too Plugins ocks Settings Help Debug date v date(nt 7, in 2012 4, n Management chad bigler. ex 10_2 6 cpp X Projects symbols Files FS O workspao 5 class dat a- Chapter 10 private e-B Sources int month i.. ad bigler ex-10 2 6cpp int day: int year; 10 public 11 date (int 7, int 4, int 2012 12 void setdate int int, int 13 void showdate 14 15 date date (int mum, int dd, int yyyy 16 month 17 day dd: 18 year yyyy 20 void date setdate int mm, int dd, int yyyy 21 month, 22 day dd; 23 year 24 return. 25 26 void date showdate f cout Th Date is"; 28 cout setfill ('0') setw (2) month 29 set (2) y 30 setw 12 year 100 31 32 cout endl. 33 34 C: Users chad Document chapter 10 6Mchad bigler ex 10.2 6.cpp WINDOWS-1252 Line 15, Column 38 ReadW ite default 4:29 PM /30/2016Explanation / Answer
Add this member method to the class:
void date::convert(int mm, int dd, int yyyy){
int cal;
month=mm;
day=dd;
year=yyyy;
cout<< "The date is"<<month
cout<< "The month is"<<day
cout<< "The year is"<<year
cal=(year * month * 100) + day;
return cal;
}
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.