當前位置:首頁 » 招生排名 » c大學教程第五版答案

c大學教程第五版答案

發布時間: 2022-03-09 00:08:53

⑴ c語言大學教程(第六版)從哪找到答案呢

網路里搜,或者直接問老師要

⑵ C++大學教程(第五版)張引等翻譯的,這本書怎麼樣 - C / C++ -

非常棒的一本書。由目標引導出具體的做法,不像有些書,看過以後能幹什麼都不知道。好像挺貴,98。

⑶ C++大學教程(第五版) (美)戴特爾 下載

只給你找到了實體書,沒有電子書。鏈接是http://youa..com/item/0c7e5b4c3f4534d58c1f6c83

⑷ 求《C 大學教程》/《C how to program》第5版 課後練習答案

《c大學教程 (Deitle 著) 電子工業出版社 課後答案》
是不是這個?

⑸ C++大學教程(第5版)課後答案

http://www.gougou.com/search?search=c%2B%2B%E8%AF%BE%E5%90%8E%E7%AD%94%E6%A1%88&restype=-1&id=10000001&ty=0&pattern=0
自己下載吧,有你需要的。

⑹ c how to program (c語言大學教程Deitel 答案 第六版,沒有6的,5的也好,4的也行啊!!!

推薦c (c++ )primer

⑺ 《c大學教程》第五版 習題答案 為提供者追加200分

第四版的答案:

http://www.rayfile.com/zh-cn/files/c4d7ca40-8d1e-11dd-9634-0019d11a795f/

⑻ 求《C++大學基礎教程》 第五版 deitel 著 電子工業出版社 課後答案 是基礎教程!!!

C 大學基礎教程 課後答案DEITEL版 3.11 GradeBook類定義 include ltstringgt // program uses C standard string class using std::string class GradeBook public: // constructor initializes course name and instructor name GradeBook string string void setCourseName string // function to set the course name string getCourseName // function to retrieve the course name void setInstructorName string // function to set instructor name string getInstructorName // function to retrieve instructor name void displayMessage // display welcome message and instructor name private: string courseName // course name for this GradeBook string instructorName // instructor name for this GradeBook // end class GradeBook 類成員函數 include ltiostreamgt using std::cout using std::endl include quotGradeBook.hquot // constructor initializes courseName and instructorName // with strings supplied as arguments GradeBook::GradeBook string course string instructor setCourseName course // initializes courseName setInstructorName instructor // initialiZes instructorName // end GradeBook constructor // function to set the course name void GradeBook::setCourseName string name courseName name // store the course name // end function setCourseName // function to retrieve the course name string GradeBook::getCourseName return courseName // end function getCourseName // function to set the instructor name void GradeBook::setInstructorName string name instructorName name // store the instructor name // end function setInstructorName // function to retrieve the instructor name string GradeBook::getInstructorName return instructorName // end function getInstructorName // display a welcome message and the instructors name void GradeBook::displayMessage // display a welcome message containing the course name cout ltlt quotWelcome to the grade book fornquot ltlt getCourseName ltlt quotquot ltlt endl // display the instructors name cout ltlt quotThis course is presented by: quot ltlt getInstructorName ltlt endl // end function displayMessage 測試文件 include ltiostreamgt using std::cout using std::endl // include definition of class GradeBook from GradeBook.h include quotGradeBook.hquot // function main begins program execution int main // create a GradeBook object pass a course name and instructor name GradeBook gradeBook quotCS101 Introction to C Programmingquot quotProfessor Smithquot // display initial value of instructorName of GradeBook object cout ltlt quotgradeBook instructor name is: quot ltlt gradeBook.getInstructorName ltlt quotnnquot // modify the instructorName using set function gradeBook.setInstructorName quotAssistant Professor Batesquot // display new value of instructorName cout ltlt quotnew gradeBook instructor name is: quot ltlt gradeBook.getInstructorName ltlt quotnnquot // display welcome message and instructors name gradeBook.displayMessage return 0 // indicate successful termination // end main 3.12 類定義 class Account public: Account int // constructor initializes balance void credit int // add an amount to the account balance void debit int // subtract an amount from the account balance int getBalance // return the account balance private: int balance // data member that stores the balance // end class Account 類成員函數 include ltiostreamgt using std::cout using std::endl include quotAccount.hquot // include definition of class Account // Account constructor initializes data member balance Account::Account int initialBalance balance 0 // assume that the balance begins at 0 // if initialBalance is greater than 0 set this value as the // balance of the Account otherwise balance remains 0 if initialBalance gt 0 balance initialBalance // if initialBalance is negative print error message if initialBalance lt 0 cout ltlt quotError: Initial balance cannot be negative.nquot ltlt endl // end Account constructor // credit add an amount to the account balance void Account::credit int amount balance balance amount // add amount to balance // end function credit // debit subtract an amount from the account balance void Account::debit int amount if amount gt balance // debit amount exceeds balance cout ltlt quotDebit amount exceeded account balance.nquot ltlt endl if amount lt balance // debit amount does not exceed balance balance balance - amount // end function debit // return the account balance int Account::getBalance return balance // gives the value of balance to the calling function // end function getBalance 測試函數 include ltiostreamgt using std::cout using std::cin using std::endl // include definition of class Account from Account.h include quotAccount.hquot // function main begins program execution int main Account account1 50 // create Account object Account account2 25 // create Account object // display initial balance of each object cout ltlt quotaccount1 balance: quot ltlt account1.getBalance ltlt endl cout ltlt quotaccount2 balance: quot ltlt account2.getBalance ltlt endl int withdrawalAmount // stores withdrawal amount read from user cout ltlt quotnEnter withdrawal amount for account1: quot // prompt cin gtgt withdrawalAmount // obtain user input cout ltlt quotnattempting to subtract quot ltlt withdrawalAmount ltlt quot from account1 balancennquot account1.debit withdrawalAmount // try to subtract from account1 // display balances cout ltlt quotaccount1 balance: quot ltlt account1.getBalance ltlt endl cout ltlt quotaccount2 balance: quot ltlt account2.getBalance ltlt endl cout ltlt quotnEnter withdrawal amount for account2: quot // prompt cin gtgt withdrawalAmount // obtain user input cout ltlt quotnattempting to subtract quot ltlt withdrawalAmount ltlt quot from account2 balancennquot account2.debit withdrawalAmount // try to subtract from account2 // display balances cout ltlt quotaccount1 balance: quot ltlt account1.getBalance ltlt endl cout ltlt quotaccount2 balance: quot ltlt account2.getBalance ltlt endl return 0 // indicate successful termination // end main 3.13 類定義 include ltstringgt // program uses C standard string class using std::string // Invoice class definition class Invoice public: // constructor initializes the four data members Invoice string string int int // set and get functions for the four data members void setPartNumber string // part number string getPartNumber void setPartDescription string // part description string getPartDescription void setQuantity int // quantity int getQuantity void setPricePerItem int // price per item int getPricePerItem // calculates invoice amount by multiplying quantity x price per item int getInvoiceAmount private: string partNumber // the number of the part being sold string partDescription // description of the part being sold int quantity // how many of the items are being sold int pricePerItem // price per item // end class Invoice 類成員函數 include ltiostreamgt using std::cout using std::endl // include definition of class Invoice from Invoice.h include quotInvoice.hquot // Invoice constructor initializes the classs four data members Invoice::Invoice string number string description int count int price setPartNumber number // store partNumber setPartDescription description // store partDescription setQuantity count // validate and store quantity setPricePerItem price // validate and store pricePerItem // end Invoice constructor // set part number void Invoice::setPartNumber string number partNumber number // no validation needed // end function setPartNumber // get part number string Invoice::getPartNumber return partNumber // end function getPartNumber // set part description void Invoice::setPartDescription string description partDescription description // no validation needed // end function setPartDescription // get part description string Invoice::getPartDescription return partDescription // end function getPartDescription // set quantity if not positive set to 0 void Invoice::setQuantity int count if count gt 0 // if quantity is positive quantity count // set quantity to count if count lt 0 // if quantity is not positive quantity 0 // set quantity to 0 cout ltlt quotnquantity cannot be negative. quantity set to 0.nquot // end if // end function setQuantity // get quantity int Invoice::getQuantity return quantity // end function getQuantity // set price per item if not positive set to 0 void Invoice::setPricePerItem int price if price gt 0 // if price is positive pricePerItem price // set pricePerItem to price if price lt 0 // if price is not positive pricePerItem 0 // set pricePerItem to 0 cout ltlt quotnpricePerItem cannot be negative. quot ltlt quotpricePerItem set to 0.nquot // end if // end function setPricePerItem // get price per item int Invoice::getPricePerItem return pricePerItem // end function getPricePerItem // calulates invoice amount by multiplying quantity x price per item int Invoice::getInvoiceAmount return getQuantity getPricePerItem // end function getInvoiceAmount 測試函數 include ltiostreamgt using std::cout using std::cin using std::endl // include definition of class Invoice from Invoice.h include quotInvoice.hquot // function main begins program execution int main // create an Invoice object Invoice invoice quot12345quot quotHammerquot 100 5 // display the invoice data members and calculate the amount cout ltlt quotPart number: quot ltlt invoice.getPartNumber ltlt endl cout ltlt quotPart description: quot ltlt invoice.getPartDescription ltlt endl cout ltlt quotQuantity: quot ltlt invoice.getQuantity ltlt endl cout ltlt quotPrice per item: quot ltlt invoice.getPricePerItem ltlt endl cout ltlt quotInvoice amount: quot ltlt invoice.getInvoiceAmount ltlt endl // modify the invoice data members invoice.setPartNumber quot123456quot invoice.setPartDescription quotSawquot invoice.setQuantity -5 //negative quantityso quantity set to 0 invoice.setPricePerItem 10 cout ltlt quotnInvoice data members modified.nnquot // display the modified invoice data members and calculate new amount cout ltlt quotPart number: quot ltlt invoice.getPartNumber ltlt endl cout ltlt quotPart description: quot ltlt invoice.getPartDescription ltlt endl cout ltlt quotQuantity: quot ltlt invoice.getQuantity ltlt endl cout ltlt quotPrice per item: quot ltlt invoice.getPricePerItem ltlt endl cout ltlt quotInvoice amount: quot ltlt invoice.getInvoiceAmount ltlt endl return 0 // indicate successful termination // end main 3.14 類定義 include ltstringgt // program uses C standard string class using std::string // Employee class definition class Employee public: Employee string string int // constructor sets data members void setFirstName string // set first name string getFirstName // return first name void setLastName string // set last name string getLastName // return last name void setMonthlySalary int // set weekly salary int getMonthlySalary // return weekly salary private: string firstName // Employees first name string lastName // Employees last name int monthlySalary // Employees salary per month // end class Employee 類成員函數 include ltiostreamgt using std::cout include quotEmployee.hquot // Employee class definition // Employee constructor initializes the three data members Employee::Employee string first string last int salary setFirstName first // store first name setLastName last // store last name setMonthlySalary salary // validate and store monthly salary // end Employee constructor // set first name void Employee::setFirstName string name firstName name // no validation needed // end function setFirstName // return first name string Employee::getFirstName return firstName // end function getFirstName // set last name void Employee::setLastName string name lastName name // no validation needed // end function setLastName // return last name string Employee::getLastName return lastName // end function getLastName // set monthly salary if not positive set to 0.0 void Employee::setMonthlySalary int salary if salary gt 0 // if salary is positive monthlySalary salary // set monthlySalary to salary if salary lt 0 // if salary is not positive monthlySalary 0 // set monthlySalary to 0.0 // end function setMonthlySalary // return monthly salary int Employee::getMonthlySalary return monthlySalary // end function getMonthlySalary 測試函數 include ltiostreamgt using std::cout using std::endl include quotEmployee.hquot // include definition of class Employee // function main begins program execution int main // create two Employee objects Employee employee1 quotLisaquot quotRobertsquot 4500 Employee employee2 quotMarkquot quotSteinquot 4000 // display each Employees yearly salary cout ltlt quotEmployees yearly salaries: quot ltlt endl // retrieve and display employee1s monthly salary multiplied by 12 int monthlySalary1 employee1.getMonthlySalary cout ltlt employee1.getFirstName ltlt quot quot ltlt employee1.getLastName ltlt quot: quot ltlt monthlySalary1 12 ltlt endl // retrieve and display employee2s monthly salary multiplied by 12 int monthlySalary2 employee2.getMonthlySalary cout ltlt employee2.getFirstName ltlt quot quot ltlt employee2.getLastName ltlt quot: quot ltlt monthlySalary2 12 ltlt endl // give each Employee a 10 raise employee1.setMonthlySalary monthlySalary1 1.1 employee2.setMonthlySalary monthlySalary2 1.1 // display each Employees yearly salary again cout ltlt quotnEmployees yearly salaries after 10 raise: quot ltlt endl // retrieve and display employee1s monthly salary multiplied by 12 monthlySalary1 employee1.getMonthlySalary cout ltlt employee1.getFirstName ltlt quot quot ltlt employee1.getLastName ltlt quot: quot ltlt monthlySalary1 12 ltlt endl monthlySalary2 employee2.getMonthlySalary cout ltlt employee2.getFirstName ltlt quot quot ltlt employee2.getLastName ltlt quot: quot ltlt monthlySalary2 12 ltlt endl return 0 // indicate successful termination // end main 3.15 類定義 class Date public: Date int int int // constructor initializes data members void setMonth int // set month int getMonth // return month void setDay int // set day int getDay // return day void setYear int // set year int getYear // return year void displayDate // displays date in mm/dd/yyyy format private: int month // the month of the date int day // the day of the date int year // the year of the date // end class Date 類成員函數 include ltiostreamgt using std::cout using std::endl include quotDate.hquot // include definition of class Date from Date.h // Date constructor that initializes the three data members // assume values provided are correct really should validate Date::Date int m int d int y setMonth m setDay d setYear y // end Date constructor // set month void Date::setMonth int m month m if month lt 1 month 1 if month gt 12 month 1 // end function setMonth // return month int Date::getMonth return month // end function getMonth // set day void Date::setDay int d day d // end function setDay // return day int Date::getDay return day // end function getDay // set year void Date::setYear int y year y // end function setYear // return year int Date::getYear return year // end function getYear // print Date in the format mm/dd/yyyy void Date::displayDate cout ltlt month ltlt / ltlt day ltlt / ltlt year ltlt endl // end function displayDate 測試函數 include ltiostreamgt using std::cout using std::endl include quotDate.hquot // include definition of class Date.

⑼ 求《C 大學教程》/《C how to program》第6版deitel著 課後練習答案

第五版 課後答案 (H.M.Deitel)

http://www.daanwang.com/download/90970-.html
http://www.daanwang.com/download/90970-.html
要求注冊登陸

⑽ 求《C++大學教程》(國外Harvey M.Deitel的第五版電子工業出版)社課後習題答案,我郵箱:[email protected]

laile

熱點內容
四川農業大學申請考核博士 發布:2025-10-20 08:58:11 瀏覽:981
福田雷沃重工本科生待遇怎麼樣 發布:2025-10-20 08:53:49 瀏覽:575
華為要本科生嗎 發布:2025-10-20 08:25:41 瀏覽:550
2008年青島本科生工資 發布:2025-10-20 08:04:24 瀏覽:444
東北大學藝術考研 發布:2025-10-20 07:38:35 瀏覽:299
我的大學生活txt 發布:2025-10-20 07:35:28 瀏覽:25
人民大學外語系考研 發布:2025-10-20 07:31:12 瀏覽:894
上海交通大學考研輔導班 發布:2025-10-20 07:24:54 瀏覽:420
華中農業大學細胞生物學考研群 發布:2025-10-20 07:09:36 瀏覽:558
南京大學2016考研線 發布:2025-10-20 06:43:12 瀏覽:930