do only q5 and show all the work show all the work Csc 211- SUMMER 2018-Instruct
ID: 3915735 • Letter: D
Question
do only q5 and show all the work
show all the work
Csc 211- SUMMER 2018-Instructor: A. A Name: NEATNESS COUNTS ILLEGIBLE means. (Yes; NAME on ALL PAGES) woALL WORK means INCORRECT: PLEASE PRINT CLEARLY. sheet and place the LETTER ONLY of the correet answer there. is described above Note: Please SELECT the two from the list below: o lines that must be addedl to the C S for what that a) bookType 0; bookType (string, string, double, in); b) bookType:: bookType O bookType:: bookType (string, string, double, int) c) bookType 0: bookType:: bookType (string, string, double, int); d) bookType 0: bookType (string, double, int) Write the FULL FUNCTION DEFINTION (that means, HEADER and BODY) fo DEFAULT CONSTRUCTOR HERE 5) 6) Write the FULL FUNCTION DEFINTION for the SECOND (#2) CONSTRUCTOR HERE: Page 8 of 13Explanation / Answer
5)
#include "bookType.h" //include header file of class bookType
bookType::bookType(){ //default constructor
bookName="";
bookISBN="";
price=0;
quantity=0;
}
//If we write bookType book in main ,it will call above constructor and intialise the object with above values
6)//#include "bookType.h" bookType class header file
bookType::bookType(string book,string ISBN,double cost,int num){//parameterised constructor
bookName=book;
bookISBN=ISBN;
price=cost;
quantity=num;
}
//If we call bookType book("RICH DAD","USA",30,10);
//It will create object book by calling the above parameterised constructor with default values.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.