Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Object Oriented Programming Please write the code in C++ and answer all the question JUST REPLICATE OR COPY THE CODES IN THE LINK so i

Object Oriented Programming

Please write the code in C++ and answer all the question

JUST REPLICATE OR COPY THE CODES IN THE LINK so i dont plagizarize

Thanks for the help! :)

https://www.chegg.com/homework-help/C-How-to-Program-7th-edition-chapter-9-problem-14E-solution-9780132165419

https://www.chegg.com/homework-help/C-How-to-Program-7th-edition-chapter-9-problem-16E-solution-9780132165419

https://www.chegg.com/homework-help/C-How-to-Program-7th-edition-chapter-9-problem-17E-solution-9780132165419

https://www.chegg.com/homework-help/C-How-to-Program-7th-edition-chapter-9-problem-18E-solution-9780132165419

Also provide the sample output screenshots

image text in transcribed

9.5 (complex Class) Create a class called complex for performing arithmetic with complex numbers. Write a program to test your class. Complex numbers have the form rea!Part + imaginarypart * i where i is Use double variables to represent the private data of the class. Provide a constructor that enables an object of this class to be initialized when it's declared. The constructor should contain default values in case no initializers are provided. Provide public member functions that perform the following tasks: a. Adding two complex numbers: The real parts are added together and the imaginary parts are added together. b. Subtracting two complex numbers: The real part of the right operand is subtracted from the real part of the left operand, and the imaginary part of the right operand is subtracted from the imaginary part of the left operand. c. Printing Complex numbers in the form (a, b), where a is the realart and b is the imaginary part. 9.7 (Enhancing Class rime) Modify the Time class of Figs. 9.4 D-9.5to include a tick member function that increments the time stored in a Time object by one second. Write a program that tests the tick member function in a loop that prints the time in standard format during each iteration of the loop to illustrate that the tick member function works correctly. Be sure to test the following cases: a. Incrementing into the next minute. b. Incrementing into the next hour. c. Incrementing into the next day (i.e., 11:59:59 PM to 12:00:00 AM). 9.8 (Enhancing Class Date) Modify the Date class of Figs. 9.13-9.141 to perform error checking on the initializer values for data members month, day and year. Also, provide a member function nextDay to increment the day by one. Write a program that tests function nextDay in a loop that prints the date during each iteration to illustrate that nextDay works correctly. Be sure to test the following cases: a. Incrementing into the next month. b. Incrementing into the next year. 9.9 (Combining Class Time and Class Date) Combine the modified Time class of Exercise 9.7 and the modified Date class of Exercise 9.8 into one class called DateAndnime. (In Chapter 11D, we'll discuss inheritance, which will enable us to accomplish this task quickly without modifying the existing class definitions.) Modify the tick function to call the nextDay function if the time increments into the next day. Modify functions printStandard and printUniversal to output the date and time. Write a program to test the new class DateAndTime. Specifically, test incrementing the time into the next day. 9.5 (complex Class) Create a class called complex for performing arithmetic with complex numbers. Write a program to test your class. Complex numbers have the form rea!Part + imaginarypart * i where i is Use double variables to represent the private data of the class. Provide a constructor that enables an object of this class to be initialized when it's declared. The constructor should contain default values in case no initializers are provided. Provide public member functions that perform the following tasks: a. Adding two complex numbers: The real parts are added together and the imaginary parts are added together. b. Subtracting two complex numbers: The real part of the right operand is subtracted from the real part of the left operand, and the imaginary part of the right operand is subtracted from the imaginary part of the left operand. c. Printing Complex numbers in the form (a, b), where a is the realart and b is the imaginary part. 9.7 (Enhancing Class rime) Modify the Time class of Figs. 9.4 D-9.5to include a tick member function that increments the time stored in a Time object by one second. Write a program that tests the tick member function in a loop that prints the time in standard format during each iteration of the loop to illustrate that the tick member function works correctly. Be sure to test the following cases: a. Incrementing into the next minute. b. Incrementing into the next hour. c. Incrementing into the next day (i.e., 11:59:59 PM to 12:00:00 AM). 9.8 (Enhancing Class Date) Modify the Date class of Figs. 9.13-9.141 to perform error checking on the initializer values for data members month, day and year. Also, provide a member function nextDay to increment the day by one. Write a program that tests function nextDay in a loop that prints the date during each iteration to illustrate that nextDay works correctly. Be sure to test the following cases: a. Incrementing into the next month. b. Incrementing into the next year. 9.9 (Combining Class Time and Class Date) Combine the modified Time class of Exercise 9.7 and the modified Date class of Exercise 9.8 into one class called DateAndnime. (In Chapter 11D, we'll discuss inheritance, which will enable us to accomplish this task quickly without modifying the existing class definitions.) Modify the tick function to call the nextDay function if the time increments into the next day. Modify functions printStandard and printUniversal to output the date and time. Write a program to test the new class DateAndTime. Specifically, test incrementing the time into the next day

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Professional SQL Server 2012 Internals And Troubleshooting

Authors: Christian Bolton, Justin Langford

1st Edition

1118177657, 9781118177655

More Books

Students also viewed these Databases questions