forked from matkatmusic/PFMCPP_Project3
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
1015 lines (877 loc) · 29.1 KB
/
Copy pathmain.cpp
File metadata and controls
1015 lines (877 loc) · 29.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/*
Project 3 - Part 5 / 5
video: Chapter 2 - Part 10
Scope and Lifetime tasks
Create a branch named Part5
video covered:
variable scope and lifetime relative to { }
while loops
for loops()
tasks
1) add some new member functions to EACH of your types.
2) inside these new member functions, use while() and for() loops to do something interesting
a) example: have a loop that modifies a member variable of some object created outside the loop.
b) when that member variable reaches a certain threshold, return it mid-loop.
c) maybe use function parameters to control the starting value of that member variable or control the threshold
3) call those new member functions in main()
4) use std::cout statements to print out information about what your loops did.
Your code should produce a lot of console output now.
5) Remember to use pre-increment/decrement in your loops.
You can learn why post-increment/decrement is not ideal here:
https://en.cppreference.com/w/cpp/language/operator_incdec
6) click the [run] button. Clear up any errors or warnings as best you can.
if your code produces a -Wpadded warning, add '-Wno-padded' to the .replit file with the other compiler flags (-Weverything -Wno-missing-prototypes etc etc)
*/
#include <iostream>
namespace Example
{
struct Bar
{
int num = 0;
Bar(int n) : num(n) { }
};
struct Foo
{
Bar scopeLifetimeFunc( int threshold, int startingVal ) //1), 2c)
{
Bar bar(startingVal); //2a)
while( bar.num < threshold ) //2a)
{
++bar.num; //2a), 5)
std::cout << " increasing bar.num: " << bar.num << std::endl; //4)
if( bar.num >= threshold ) //2b)
return bar;
}
return Bar {-1}; //if your startingValue >= threshold, the while loop never runs
}
};
int main()
{
Foo foo;
auto bar = foo.scopeLifetimeFunc(3, 1); //3)
std::cout << "bar.num: " << bar.num << std::endl; //4)
return 0;
}
}
//call Example::main() in main()
struct Television
{
float levelOfVolume;
double levelOfBrightness {87.56};
int numOfScreenModes;
std::string televisionManufacturer = "Samsung";
int numOfInputs;
int numOfChannels {200};
Television();
int increaseVolume(int decibelOutput); //returns decibel volume ++
void changeDisplaySettings();
int decreaseBrightness(int nitOutput); // returns nit value --
void printTelevisionVars();
int scanForChannels(int channelNumStart)
{
for(int i = channelNumStart; i < numOfChannels; ++i)
{
std::cout << "Discovered Channel: " << i << " \n";
}
return channelNumStart;
}
};
Television::Television() :
levelOfVolume(50.f),
numOfScreenModes(6),
numOfInputs(4)
{
std::cout << "Television is being constructed!" << std::endl;
}
int Television::increaseVolume(int decibelOutput)
{
++decibelOutput;
std::cout << decibelOutput << "\n";
return decibelOutput;
}
void Television::changeDisplaySettings()
{
int displaySelector = 0;
int displaySetting = 0;
int tvInput1 = 1;
int tvInput2 = 2;
int tvInputHDMI = 3;
int tvInputBT = 4;
std::cout << "Please select Input 1, 2, 3 HDMI, or 4 BlueTooth\n";
if(displaySelector == 1)
{
displaySetting = tvInput1;
}
else if(displaySelector == 2)
{
displaySetting = tvInput2;
}
else if (displaySelector == 3)
{
displaySetting = tvInputHDMI;
}
else if (displaySelector == 4)
{
displaySetting = tvInputBT;
}
else
{
std::cout << "Inavlid Selection \n";
}
std::cout << displaySetting << " Selected\n";
}
int Television::decreaseBrightness(int nitOutput)
{
--nitOutput;
std::cout << nitOutput << "\n";
return nitOutput;
}
void Television::printTelevisionVars()
{
std::cout << "levelOfVolume: " << levelOfVolume << "\n";
std::cout << "levelOfBrightness: " << levelOfBrightness << "\n";
std::cout << "numOfScreenModes: " << numOfScreenModes << "\n";
std::cout << "televisionManufacturer: " << televisionManufacturer << "\n";
std::cout << "numOfInputs: " << numOfInputs << "\n\n";
}
struct MassageChair
{
int numOfVibrationControls {9};
int appliedPressure {10}; //measured in PSI
float backrestReclineAngle = 34.6f;
double massageDuration;
float footrestInclineAngle;
MassageChair();
void giveMassage(bool startMassage);
void playBackgroundSound();
int displayTimer(int msgDuration); // displays how much time is left on massage.
void printMassageChairVars();
bool startVibration(bool startMassage)
{
startMassage == false ? std::cout << "would you like to start a massage?\n" : std::cout << "starting\n";
while(startMassage == true)
{
--massageDuration;
massageDuration < 0.1 ? startMassage = false : startMassage = true;
}
return startMassage;
}
};
MassageChair::MassageChair() :
massageDuration(30.00),
footrestInclineAngle(90.f)
{
std::cout << "MassageChair is being constructed!" << std::endl;
}
void MassageChair::giveMassage(bool startMassage)
{
if(startMassage == true)
{
std::cout << "Please remove shoes, and relax!!\n";
}
else
{
std::cout << "No Massage For You!\n";
}
}
void MassageChair::playBackgroundSound()
{
std::cout << "Now playing! \n";
}
int MassageChair::displayTimer(int msgDuration)
{
std::cout << "now counting down from " << msgDuration << "minuntes\n";
int secs = 60, mins = msgDuration;
while(mins >= 0)
{
--secs;
if(mins > 0 && secs == 0)
{
--mins;
secs += 60;
while(mins == 0 && secs > 0)
{
--secs;
}
}
else if(mins == 0 && secs < 0)
{
std::cout << "Massage Complete\n";
break;
}
std::cout << mins << " : " << secs << "\n";
}
return msgDuration;
}
void MassageChair::printMassageChairVars()
{
std::cout << "numOfVibrationControls: " << numOfVibrationControls << " \n";
std::cout << "appliedPressure: " << appliedPressure << " \n";
std::cout << "backrestReclineAngle: " << backrestReclineAngle << "\n";
std::cout << "massageDuration: " << massageDuration << "\n";
std::cout << "footrestInclineAngle: " << footrestInclineAngle << "\n\n";
}
struct CollegeStudent
{
int numOfEnrolledClasses {7};
double gpa {3.64};
int booksRead = 0;
std::string studentName = "Student's Name";
std::string subjectMajor;
std::string expectedGraduationDate;
CollegeStudent();
void attendStudyHall();
void watchTelevision(CollegeStudent newStudent);
void danceToMusic();
void printCollegeStudent();
int readBook(int totalPages)
{
for(int i = 1; i <= totalPages; ++i)
{
std::cout << "Page " << i << " complete\n";
if(i == totalPages)
{
std::cout << "book complete\n";
++booksRead;
}
}
std::cout << "congratulations!! you have finished book number: " << booksRead << " \n";
return booksRead;
}
};
CollegeStudent::CollegeStudent() :
subjectMajor("Subject Major"),
expectedGraduationDate("DD MM YY")
{
std::cout << "CollegeStudent is being constructed!" << std::endl;
}
void CollegeStudent::attendStudyHall()
{
std::cout << studentName << "is now attending study hall\n";
}
void CollegeStudent::watchTelevision(CollegeStudent newStudent)
{
std::cout << newStudent.studentName << " is now watching TV\n";
}
void CollegeStudent::danceToMusic()
{
std::cout << studentName << " is now dancing to the music\n";
}
void CollegeStudent::printCollegeStudent()
{
std::cout << "numOfEnrolledClasses: " << numOfEnrolledClasses << " \n";
std::cout << "gpa: " << gpa << " \n";
std::cout << "studentName: " << studentName << "\n";
std::cout << "subjectMajor: " << subjectMajor << "\n";
std::cout << "expectedGraduationDate: " << expectedGraduationDate << "\n\n";
}
struct PetCat
{
int numOfEyes {2};
double legnthOfTail {10.35};
std::string furColor = "Grey & White";
int ageOfCat;
std::string nameOfPetCat;
bool maleGender;
bool catHungry = true;
struct CatCollar
{
std::string materialOfCollar {"Nylon"};
float collarMeasurement {10.2f};
bool isWaterProof = true;
bool hasCollarBuckle;
int numOfHolesForBuckle;
int leashLength;
CatCollar();
void repelFleas(int repellantStrength, std::string repellantExpiration);
void attachLeash();
int tightenCollar(int bucklePosition);
void printCatCollarVars();
int leashExtend(int desiredLength)
{
if(desiredLength > leashLength)
{
std::cout << "leash isn't that long!\n";
}
else
{
for(int i = 0; i < desiredLength; ++i)
{
std::cout << "extending to " << i << " \n";
}
}
return desiredLength;
}
};
PetCat();
void takeOffCollar(CatCollar newCollar);
void knockOverObjects();
void scratchVisitors();
CatCollar replacementCollar;
void printPetCatVars();
void catEatFood()
{
int nomNomNom = 0;
if(catHungry == true)
{
while(catHungry == true && nomNomNom <= 3)
{
++nomNomNom;
std::cout << "nom nom nom... im still hungry!\n";
if(nomNomNom > 3)
{
std::cout << "Meow... I'm Full now.\n";
catHungry = false;
}
}
}
}
};
PetCat::CatCollar::CatCollar() :
hasCollarBuckle(true),
numOfHolesForBuckle(4),
leashLength(10)
{
std::cout << "CatCollar is being constructed!" << std::endl;
}
void PetCat::CatCollar::repelFleas(int repellantStrength, std::string repellantExpiration)
{
std::cout << repellantStrength << "is the repellant strength of this collar\n";
std::cout << repellantExpiration << "is the expiration date\n";
}
void PetCat::CatCollar::attachLeash()
{
std::cout << "Now attaching leash...\n";
if(isWaterProof == true)
{
std::cout << "don't be afraid to get a little wet\n";
}
}
int PetCat::CatCollar::tightenCollar(int bucklePosition)
{
if(hasCollarBuckle == true && bucklePosition <= numOfHolesForBuckle)
{
--bucklePosition;
std::cout << "collar has been tightened\n";
}
else
{
std::cout << "This collar only has " << numOfHolesForBuckle << " please inut a whole number smaller or equal to that\n";
}
return bucklePosition;
}
void PetCat::CatCollar::printCatCollarVars()
{
std::cout << "materialOfCollar: " << materialOfCollar << " \n";
std::cout << "collarMeasurement: " << collarMeasurement << " \n";
std::cout << "isWaterProof: " << isWaterProof << "\n";
std::cout << "hasCollarBuckle: " << hasCollarBuckle << "\n";
std::cout << "numOfHolesForBuckle: " << numOfHolesForBuckle << "\n\n";
}
PetCat::PetCat() :
ageOfCat(3),
nameOfPetCat("Doris"),
maleGender(false)
{
std::cout << "PetCat is being constructed!" << std::endl;
}
void PetCat::takeOffCollar(CatCollar newCollar)
{
std::cout << nameOfPetCat << " has removed her collar please replace it\n";
replacementCollar = newCollar;
}
void PetCat::knockOverObjects()
{
std::cout << nameOfPetCat << " has knock over an Object\n";
}
void PetCat::scratchVisitors()
{
std::cout << nameOfPetCat << " has scratched a visitor\n";
}
void PetCat::printPetCatVars()
{
std::cout << "numOfEyes: " << numOfEyes << " \n";
std::cout << "legnthOfTail: " << legnthOfTail << " \n";
std::cout << "furColor: " << furColor << "\n";
std::cout << "ageOfCat: " << ageOfCat << "\n";
std::cout << "maleGender: " << maleGender << "\n";
std::cout << "nameOfPetCat: " << nameOfPetCat << "\n\n";
}
struct Human
{
int ageInYears {33};
std::string nameOfHuman {"First Last"};
std::string ethnicity = "Black/African American";
int dateOfBirth;
std::string bloodType;
int amountOfBlood;
bool isAngry = false;
struct HealthStatus
{
int numOfHealthComplications {0};
bool chronicDiseasesPresent {false};
bool goToAppointment = false;
std::string dateOfLastCheckup = "23 Feburary 2022";
float bodyMassIndex;
std::string bloodPressureLevel;
HealthStatus();
void contractSTD(std::string whichSTD, std::string dateContracted);
void developeHealthCondition(bool isHereditary, std::string knownSymptoms, std::string conditionName);
void scheduleCheckUp(std::string returnDate, bool sameDoctor);
void printHealthStatusVars();
int countdownNextVisit(int daysSinceLastVisit)
{
int daysLeft = 365 - daysSinceLastVisit;
for(int i = daysLeft; i > 0; --i)
{
std::cout << i << " days left until next visit\n";
}
goToAppointment = true;
return daysLeft;
}
};
Human();
void visitDoctor(HealthStatus updateHealthStatus);
void goToSleep(int howLong);
void donateBlood(Human girlfriend, bool giveLeftArm);
HealthStatus healthStatus;
void printHumanVars();
};
Human::HealthStatus::HealthStatus() :
bodyMassIndex(23.8f),
bloodPressureLevel("120/83 mmHg")
{
std::cout << "HealthStatus is being constructed!" << std::endl;
}
Human::Human() :
dateOfBirth(12181989),
bloodType("O Negative"),
amountOfBlood(5000) //mL
{
std::cout << "Human being constructed!" << std::endl;
}
void Human::HealthStatus::contractSTD(std::string whichSTD, std::string dateContracted)
{
std::cout << "Your tested positive for the folling STD " << whichSTD << " which was contracted on" << dateContracted <<" \n";
}
void Human::HealthStatus::developeHealthCondition(bool isHereditary, std::string knownSymptoms, std::string conditionName)
{
std::cout << "You have noticed having" << knownSymptoms << " \n";
std::cout << "which are symptoms of " << conditionName << " \n";
if(isHereditary == true) std::cout << "this condition is hereditary";
}
void Human::HealthStatus::scheduleCheckUp(std::string returnDate, bool sameDoctor)
{
returnDate = "Day/Month/Year";
sameDoctor = true;
}
void Human::HealthStatus::printHealthStatusVars()
{
std::cout << "numOfHealthComplications: " << numOfHealthComplications << " \n";
std::cout << "chronicDiseasesPresent: " << chronicDiseasesPresent << " \n";
std::cout << "dateOfLastCheckup: " << dateOfLastCheckup << "\n";
std::cout << "bodyMassIndex: " << bodyMassIndex << "\n";
std::cout << "bloodPressureLevel: " << bloodPressureLevel << "\n\n";
}
void Human::visitDoctor(HealthStatus updateHealthStatus)
{
//I would ideally update all the member variables of HealthStatus here with std::cin's.
std::cout << "Blood Pressure: " << updateHealthStatus.bloodPressureLevel << " \n";
std::cout << "Body Mass Index: " << updateHealthStatus.bodyMassIndex << " \n";
std::cout << "Chronic Diseases Present: " << updateHealthStatus.chronicDiseasesPresent << " \n";
std::cout << "Date Of Last Check-Up: " << updateHealthStatus.dateOfLastCheckup << " \n";
std::cout << "Number of Complications: " << updateHealthStatus.numOfHealthComplications << " \n";
//here I would replace dateOfLastCheckup with todays date.
updateHealthStatus.goToAppointment = false;
}
void Human::goToSleep(int howLong)
{
std::cout << nameOfHuman << " is going to get " << howLong << " hours of sleep!\n";
}
void Human::donateBlood(Human girlfriend, bool giveLeftArm)
{
if(giveLeftArm == true)
{
std::cout << "you have decided to donate from your left arm\n";
}
else
{
std::cout << "you have decided to donate from your right arm\n";
}
int bloodDonated = 0;
while(bloodDonated < 500 || girlfriend.amountOfBlood < 4000)
{
bloodDonated += 100;
girlfriend.amountOfBlood -= 100;
std::cout << "still donating: " << bloodDonated << "/500... hang in there.\n";
}
std::cout << "all done, go home\n";
}
void Human::printHumanVars()
{
std::cout << "ageInYears: " << ageInYears << " \n";
std::cout << "nameOfHuman: " << nameOfHuman << " \n";
std::cout << "ethnicity: " << ethnicity << "\n";
std::cout << "dateOfBirth: " << dateOfBirth << "\n";
std::cout << "bloodType: " << bloodType << "\n\n";
}
struct SocialStatus
{
double netWorth {109841.65};
std::string occupation {"Accountant"};
int numOfFriends = 28;
double annualIncome; //in USD
int numOfClubMemberships;
SocialStatus();
void attractMoreFriends(bool rejectNewFriend);
void getExclusiveDeals();
void bypassSocietalNorms();
double capitalGainsFromInvestment(double moneyInvested, int forHowLong)
{
std::cout << "your current balance before the investment is: " << netWorth << " \n";
double interest = moneyInvested * 0.12;
int investmentTerm = 0;
while(investmentTerm < forHowLong)
{
moneyInvested += interest;
std::cout << moneyInvested << " added to your bank account\n";
netWorth += moneyInvested;
++investmentTerm;
}
std::cout << "your new balance is: " << netWorth << " \n";
return netWorth;
}
void printSocialStatusVars();
};
SocialStatus::SocialStatus() :
annualIncome(181650.23),
numOfClubMemberships(5)
{
std::cout << "SocialStatus is being constructed!" << std::endl;
}
void SocialStatus::attractMoreFriends(bool rejectNewFriend)
{
if(rejectNewFriend == false)
{
std::cout << "you now have 1 new friend added to your network!\n";
}
else
{
std::cout << "NO NEW FRIENDS!!\n";
}
}
void SocialStatus::getExclusiveDeals()
{
std::cout << "because of your " << netWorth << " net worth you are entitled to exclusive deals\n";
}
void SocialStatus::bypassSocietalNorms()
{
std::cout << "you are NOT beholden to social norms";
}
void SocialStatus::printSocialStatusVars()
{
std::cout << "netWorth: " << netWorth << " \n";
std::cout << "occupation: " << occupation << " \n";
std::cout << "numOfFriends: " << numOfFriends << "\n";
std::cout << "annualIncome: " << annualIncome << "\n";
std::cout << "numOfClubMemberships: " << numOfClubMemberships << "\n\n";
}
struct PhysicalAttribrutes
{
int amountOfLimbs {4};
std::string currentEyeColor {"brown"};
float currentHeight = 4.7f;
float currentWeight;
std::string currentHairColor;
PhysicalAttribrutes();
void selectHairColor(std::string colorChoice);
float increaseWeight(float addedPounds); //returns current weight + amount of lbs added.
void loseLimb();
void printPhysicalAttribrutesVars();
float hitPuberty(Human newHuman, PhysicalAttribrutes newPhysAtt)
{
if(newHuman.ageInYears < 16)
{
while(newPhysAtt.currentHeight <= 5.0f)
{
newPhysAtt.currentHeight += 0.1f;
std::cout << "you grew to " << newPhysAtt.currentHeight << " wow you're getting tall!\n";
}
}
else
{
std::cout << "you are to old to go through puberty\n";
}
return newPhysAtt.currentHeight;
}
};
PhysicalAttribrutes::PhysicalAttribrutes() :
currentWeight(167.93f),
currentHairColor("Dark Brown")
{
std::cout << "PhysicalAttribrutes is being constructed!" << std::endl;
}
void PhysicalAttribrutes::selectHairColor(std::string colorChoice)
{
std::cout << colorChoice << " has been selected as the new hair color\n";
}
float PhysicalAttribrutes::increaseWeight(float addedPounds)
{
++addedPounds;
return addedPounds;
}
void PhysicalAttribrutes::loseLimb()
{
--amountOfLimbs;
std::cout << "you lost a limb you now have " << amountOfLimbs << "limbs!\n";
}
void PhysicalAttribrutes::printPhysicalAttribrutesVars()
{
std::cout << "amountOfLimbs: " << amountOfLimbs << " \n";
std::cout << "currentEyeColor: " << currentEyeColor << " \n";
std::cout << "currentHeight: " << currentHeight << "\n";
std::cout << "currentWeight: " << currentWeight << "\n";
std::cout << "currentHairColor: " << currentHairColor << "\n\n";
}
struct Education
{
std::string mostRecentSchool {"Florida Atlantic University"};
int numOfYearsAttended {6};
std::string highestDegreeAttained = "Master of Arts";
int positionInClass;
std::string orgSubjectMajor;
Education();
std::string addDegree(std::string newestDegree); //returns newly added degree
void dropOutOfSchool();
std::string changeMajor(std::string whichMajor, std::string degreeLevel); //returns options for majors in accordance with associated degree level
void attainNewDegree(int howLongIsProgram, Education moreEducation)
{
for(int yrsComplete = 0; yrsComplete <= howLongIsProgram; ++yrsComplete)
{
int yrsLeft = howLongIsProgram - yrsComplete;
std::cout << "you've completed " << yrsComplete << " you have " << yrsLeft << " until program is complete\n";
++moreEducation.numOfYearsAttended;
}
std::cout << "New degree compelete!\n";
}
void printEducationVars();
};
Education::Education() :
positionInClass(211),
orgSubjectMajor("Finance")
{
std::cout << "Education being constructed!" << std::endl;
}
std::string Education::addDegree(std::string newestDegree)
{
return newestDegree;
}
void Education::dropOutOfSchool()
{
std::cout << "You have just dropped out of " << mostRecentSchool << ", what will you do now\n";
}
std::string Education::changeMajor(std::string whichMajor, std::string degreeLevel)
{
std::cout << "we have changed your degree to " << whichMajor << "this is a " << degreeLevel << "degree.";
return "best of luck";
}
void Education::printEducationVars()
{
std::cout << "mostRecentSchool: " << mostRecentSchool << " \n";
std::cout << "numOfYearsAttended: " << numOfYearsAttended << " \n";
std::cout << "highestDegreeAttained: " << highestDegreeAttained << "\n";
std::cout << "positionInClass: " << positionInClass << "\n";
std::cout << "orgSubjectMajor: " << orgSubjectMajor << "\n\n";
}
struct Home
{
int numOfRooms;
double propertySize;
std::string homeAddress = "123 Main St, Orange Grove CA, 34567";
std::string homeColor = "New Color";
double propertyValue {375400.00};
int numOfAppliances {10};
Home();
void appreaciateInValue(int years);
std::string newPaintColor(std::string whatColor);
void addRoomToHouse();
std::string deteriorateOverTime(std::string brokenItem); //display what needs to be fixed.
void printHomeVars();
};
Home::Home() :
numOfRooms(5),
propertySize(1373.56)
{
std::cout << "Home being constructed!" << std::endl;
}
std::string Home::newPaintColor(std::string whatColor)
{
homeColor = whatColor;
return whatColor;
}
void Home::appreaciateInValue(int years)
{
for(int i = 0; i < years; ++i)
{
propertyValue += 10560.95;
std::cout << "your home's value went up to" << propertyValue << " \n";
}
}
void Home::addRoomToHouse()
{
++numOfRooms;
std::cout << "Congratulations!! you have just added a room to your house! you now have " << numOfRooms << "rooms\n";
}
std::string Home::deteriorateOverTime(std::string brokenItem)
{
std::cout << brokenItem << " is broken, replace it now.\n";
return brokenItem;
}
void Home::printHomeVars()
{
std::cout << "numOfRooms: " << numOfRooms << " \n";
std::cout << "propertySize: " << propertySize << " \n";
std::cout << "homeAddress: " << homeAddress << "\n";
std::cout << "propertyValue: " << propertyValue << "\n";
std::cout << "numOfAppliances: " << numOfAppliances << "\n\n";
}
struct Girlfriend
{
Human human;
SocialStatus socialStatus;
PhysicalAttribrutes physicalAttribrutes;
Education education;
Home home;
Girlfriend();
std::string planDinnerDate(std::string whatRestaurant, std::string whenToGo, std::string whatTime); //should return prompt controlled by if statements
void presentIdeas(Human girlfriend);
bool buildFurniture (Human girlfriend, bool carpetrySkills);
int bringUpIssue(Human girlfriend, int timesAsked, std::string issueName)
{
while(timesAsked < 3)
{
girlfriend.isAngry = false;
std::cout << "hey just reminding you to address the " << issueName << " \n";
++timesAsked;
}
while(timesAsked < 10)
{
girlfriend.isAngry = true;
std::cout << "Are you even going to do anything about the " << issueName << " \n";
++timesAsked;
}
if(timesAsked > 10)
{
std::cout << "I give up, Im not wasting my energy...\n";
girlfriend.isAngry = false;
}
return timesAsked;
}
};
Girlfriend::Girlfriend()
{
std::cout << "Girlfriend is being constructed!" << std::endl;
}
std::string Girlfriend::planDinnerDate(std::string whatRestaurant, std::string whenToGo, std::string whatTime)
{
std::string dinnerPlans = whatRestaurant + whenToGo + whatTime;
whatRestaurant = "this Restaurnt";
whenToGo = "Day/Month/Year";
whatTime = "8:00pm";
return dinnerPlans;
}
void Girlfriend::presentIdeas(Human girlfriend)
{
std::cout << girlfriend.nameOfHuman << " has an interesting proposal you should consider\n";
}
bool Girlfriend::buildFurniture (Human girlfriend, bool carpetrySkills)
{
if(carpetrySkills == true)
{
std::cout << girlfriend.nameOfHuman << "can build whatever you need.\n";
return true;
}
std::cout << girlfriend.nameOfHuman << " cannot build you furniture.\n";
return false;
}
int main()
{
Example::main();
Television samsung; //done
samsung.decreaseBrightness(98);
samsung.changeDisplaySettings();
samsung.increaseVolume(37);
samsung.scanForChannels(191);
samsung.printTelevisionVars();
MassageChair osakiOS4000T; //done
osakiOS4000T.giveMassage(true);
osakiOS4000T.displayTimer(1);
osakiOS4000T.playBackgroundSound();
osakiOS4000T.printMassageChairVars();
CollegeStudent rickSanchez; //done
rickSanchez.studentName = "Rick Sanchez";
rickSanchez.booksRead = 0;
rickSanchez.attendStudyHall();
rickSanchez.danceToMusic();
rickSanchez.watchTelevision(rickSanchez);
rickSanchez.readBook(10);
rickSanchez.printCollegeStudent();
PetCat::CatCollar friscoBreakaway; //done
friscoBreakaway.repelFleas(10, "12/12/2012");
friscoBreakaway.attachLeash();
friscoBreakaway.tightenCollar(3);
friscoBreakaway.leashExtend(8);
friscoBreakaway.printCatCollarVars();
PetCat doris; //done
doris.knockOverObjects();
doris.scratchVisitors();
doris.takeOffCollar(friscoBreakaway);
doris.catEatFood();
doris.printPetCatVars();
Human::HealthStatus may5thUpdate; //done
may5thUpdate.contractSTD("Cold Sore", "10/28/2021");
may5thUpdate.developeHealthCondition(false, "small blisters around body", "chickenpox");
may5thUpdate.scheduleCheckUp("11/22/2024", true);
may5thUpdate.countdownNextVisit(355);
may5thUpdate.printHealthStatusVars();
Human julianneCabour; //done
julianneCabour.nameOfHuman = "Julianne Cabour";
julianneCabour.ageInYears = 13;
julianneCabour.goToSleep(10);
julianneCabour.donateBlood(julianneCabour, false);
julianneCabour.visitDoctor(may5thUpdate);
julianneCabour.printHumanVars();
SocialStatus upperClass; //done
upperClass.attractMoreFriends(false);
upperClass.bypassSocietalNorms();
upperClass.getExclusiveDeals();
upperClass.capitalGainsFromInvestment(100, 10);
upperClass.printSocialStatusVars();
PhysicalAttribrutes weak; //done
weak.currentHeight = 4.9f;
weak.increaseWeight(7.0);
weak.loseLimb();
weak.selectHairColor("Purple");
weak.hitPuberty(julianneCabour, weak);
weak.printPhysicalAttribrutesVars();
Education graphicDesigner; //done
graphicDesigner.changeMajor("Business", "BA");
graphicDesigner.addDegree("Computer Science");
graphicDesigner.dropOutOfSchool();
graphicDesigner.attainNewDegree(6, graphicDesigner);
graphicDesigner.printEducationVars();
Home residence; //done
residence.addRoomToHouse();