Posts
 
Reputation
Joined
Last Seen
0 Reputation Points
Unknown Quality Score

No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.

0 Endorsements
~1K People Reached
Favorite Forums
Favorite Tags
c++ x 25
Member Avatar for knellgust

[CODE]#include <iostream> using namespace std; class NumDays { private: double hours; double days; public: NumDays(double h=0) { hours=h; }[/CODE] [ICODE] how can I assign values to both hours and days, but only takes in the number of hours as its argument? I don't know how to assign the days without …

Member Avatar for xikkub
0
211
Member Avatar for knellgust

[CODE]#include <iostream> using namespace std; class NumDays { private: double hours; double days; public: NumDays(double h=0) { hours=h; days=h/8.0; } void setHours(double h) { hours=h; days=h/8.0; } double getHours() const { return hours; } void setDays(double d) { hours=d*8.0; days=d; } double getDays() const { return days; } NumDays operator …

Member Avatar for jonsca
0
99
Member Avatar for knellgust

[CODE] #include <iostream> #include<string> using namespace std; class Book { private: string title; double price; public: Book(); void setTitle(string s); void setPrice(double p); string getTitle() const {return title;} double getPrice() const {return price;} bool hasKeyword(string key); }; Book::Book() { title="None"; price=0; } void Book :: setTitle(string s) { title=s; } …

Member Avatar for Fbody
0
78
Member Avatar for knellgust

[CODE]#include <iostream> #include<string> using namespace std; class Book { private: string title; double price; public: Book(); void setTitle(string s); void setPrice(double p); string getTitle() const {return title;} double getPrice() const {return price;} bool hasKeyword(string key); }; Book::Book() { title="None"; price=0; } void Book :: setTitle(string s) { title=s; } void …

Member Avatar for alaa sam
0
175
Member Avatar for knellgust

[CODE]#include <iostream> #include<string> using namespace std; class Book { private: string title; double price; public: Book(); void setTitle(string s); void setPrice(double p); string getTitle() const {return title;} double getPrice() const {return price;} bool hasKeyword(string key); }; Book::Book() { title="None"; price=0; } void Book :: setTitle(string s) { title=s; } void …

Member Avatar for knellgust
0
99
Member Avatar for knellgust

[CODE]#include <iostream> #include<string> using namespace std; class Book { private: string title; double price; public: Book(); void setTitle(string s); void setPrice(double p); string getTitle() const; {return title;} [/CODE] [ICODE]error code C2059(syntax error: '{' ) and C2334(unexpected token preceding '{' skipping apparent function body occur [/ICODE] [CODE]double getPrice() const; {return price;}[/CODE] …

Member Avatar for SgtMe
0
165
Member Avatar for knellgust

[CODE]#include <iostream> using namespace std; const int SIZE=30; const int bSIZE=3; void Initialize(struct Book*[], int size); struct Book {string title[SIZE]; string author[SIZE];}; int main() { int choice1, choice2; string title; string author; Book *arrbook[bSIZE]; Initialize(arrbook,bSIZE); system ("pause"); return 0; } void Initialize(struct Book *[],int size) { for(int i=0; i<size; i++) …

Member Avatar for knellgust
0
153
Member Avatar for knellgust

This is a two-part problem. The first bit of code creates an array of struct, initializes the various bits, and then displays them using a pointer. [CODE]]#include <iostream> using namespace std; const int SIZE=30; const int bSIZE=3; void Initialize(struct Book*[], int size); struct Book {char title[SIZE], author[SIZE];}; int main() { …

Member Avatar for knellgust
0
79
Member Avatar for knellgust

#include <iostream> #include <iomanip> using namespace std; int main() { char item, code [5] ; double number, money; const double itemA=50, itemB=60, itemC=70, disc=0.8; const int size = 10; cout <<"Enter the item you would like to buy: A,B, or C: "; cin >> item; cout <<"Enter how many you …

Member Avatar for Stefano Mtangoo
0
102