Design an algorichm and write a C++ program that utilizes the void funetion prog
ID: 3728455 • Letter: D
Question
Design an algorichm and write a C++ program that utilizes the void funetion programmerinfo to print the programmer's name, UIN, TA name and class name along with the date. Output the function call Note: You must use a void function to receive credit for this exercise. Format the output to print neatly to the terminal. Sample Qutput rogrammer Name: 1en Wazowski UIN: 1234567 A: Mike Cool Class: CS150 F17 Date: January 8th 2018 Process returned 0 (0xe) execution time 0.078 s Press any key to continue.Explanation / Answer
void programmerInfo(string name,int UIN,string TA,string className,int date,int month,int year)
{
cout<<"Programmer Name: "<<name;
cout<<" UIN: "<<UIN;
cout<<" TA: "<<TA;
cout<<" Class: "<<className;
cout<<" ";
if (month ==1)
cout<<"January";
else if (month==2)
cout<< "February";
else if (month==3)
cout<<"March";
else if (month==4)
cout<<"April";
else if (month==5)
cout<<"May";
else if (month==6)
cout<<"June";
else if (month==7)
cout<<"July";
else if (month==8)
cout<<"August";
else if (month==9)
cout<<"September";
else if (month==10)
cout<<"October";
else if (month==11)
cout<<"November";
else if (month==12)
cout<<"December";
if(date==1)
cout<<" "<<date<<"st "<<year;
if(date==2)
cout<<" "<<date<<"nd "<<year;
if (date==3)
cout<<" "<<date<<"rd "<<year;
if(date>3)
cout<<" "<<date<<"th "<<year;
cout<<" ";
}
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.