Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

please use c++ only CIS 25 Spring 2021 - Homework #3 Update #1 - Page 1 of 8 Turn In: 1. Exercise #1 - Due

image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
please use c++ only
CIS 25 Spring 2021 - Homework #3 Update #1 - Page 1 of 8 Turn In: 1. Exercise #1 - Due on Tuesday, March 15, 2021 by 11:00pm Email Submission a) For each exercise, a package must be generated to include the following items: Copy of your source file (C++ program)- your source file MUST BE NAMED 25 cis25Spring2021 Your Name Hw3.cpp Besides the submitting the above driver, create and submit - fractionYourName.h . fractionYour Name.cpp fractionutility Your Name.h - fractionutility Your Name.cpp hw3Utility.h hw3Utility Your Name.cpp Copy of output (copy and paste to the end of your program as PROGRAM_OUTPUT comment block) Copy of Logic_code_Output_Issues (as a separate comment block) after the "PROGRAM_OUTPUT" block. b) Emailing each package as follows. One email message for each exercise, The SUBJECT line of the message should have the following line cis25Spring2021 Your NameHw3.cpp Attaching the source file that was created in part a). 2. Q.E.D. CIS 25 Spring 2021 - Homework #3 Update 31 - Page 2 of 8 1. Code Assignment/Exercise Exercise 1 A. Update the Fraction class given in the Lecture notes or as discussed in class meetings as follows. 1. Add your FIRST NAME and the initial of your last name to the name Traction and use this as your updated class. For examples, if your first name is John Smith then update the class name to be FractionJohns 2. Add and update all class constructors for your Fraction class to handle the initialization appropriately There must be as least 3 constructors of (1) Default: and Copy, and (in) Fraction(int n, int d) Euch constructor should print the confirmation (e.g. "Calling Fraction()". "Calling Fraction (const Fraction)" or "Calling Praction (int, int>"). 3. Provide a destructor with a confirmation when removing the object (ie, "Calling -Fraction()) 4. Provide get(/set() member functions for each private member data. 5. A member function print that will print the current Fraction object. B. Provide the following member functions, a. A member function isPalindrome(), which is a predicate, to return true/false if the Fraction object is a Palindrome, and b. A function displayCommon PalindromeDigit(); and c. Aged() helper to reduce the Fraction object; and C. Provide the following stand-alone functions, d. A function init() to set up or update the required Fraction object. c. An appropriate run Menuw30) function to produce the required output as displayed below; and 1. Other functions as needed C. Run a driver/program named as cis25spring2e21 Your Name w3.cpp and record the output shown below (a) The output screen should have the following lines displayed before any other display or input can be seen, CIS 25 - C++ programming Laney College YourName Information -- Assignment: Implemented by: HA #3 Exercise #1 Your Name CIS 25 Spring 2021 - Homework #3 Update #1 - Page 3 of 8 Submitted Date: 2021/03/15 Current Number of LEB available: ? Allowed Number of LEB Used: Remaining Number of LEB: (b) Then, the output screen should be followed by a sample output as follows. MENU - HWW3 . 1. Initializing . 2. ispalindrome) 3. Using displayConnonPalindromeDigit() 4. Printing 5. Quit Select an option (use integer value only): WRONG OPTION! MENU - HW33 . 1. Initializing . 2. isPalindrome() 3. Using displayConnonPalindromeDigit() 4. Printing S. Quit Select an option (use integer value only): 2 Palindrome Option - Not a proper option as there is no Fraction . . MENU - HW3 1. Initializing 2. isPalindrone() 3. Using displayCommonPalindroneDigit() 4. Printing . 5. Quit Select an option (use integer value only): 1 INITIALIZING Option - Calling runMenuInit()! SubMENU - INITIALIZING 1. Creating 2. Updating . 3. Returning Select an option (integer only): 2 Not a proper option as there is no Fraction! CIS 25 Spring 2021 - Homework #3 Update #1 - Page 4 of 8 SubMENU - INITIALIZING 1. Creating 2. Updating 3. Returning Select an option (integer only): 5 WRONG OPTION! SUBMENU - INITIALIZING 1. Creating 2. Updating . 3. Returning Select an option (integer only): 1 Creating 1 NEW Fraction object -- Calling create()! Enter num: 5 Enter denon -959 SubMENU INITIALIZING 1. Creating 2. Updating . 3. Returning Select an option (integer only): 3 Returning to previous menul . MENU - HW3 1. Initializing . 2. isPalindrome) 3. Using displayComoPalindroneDigit() 4. Printing . 5. Quit Select an option (use integer value only): 4 PRINTING Option - Address : 8041F0D4 num t -5 denon ! 959 MENU - HW #3 . 1. Initializing 2. ispalindrone) 3. Using displayCommon PalindromeDigit() 4. Printing 5. Quit . . CIS 25 Spring 2021 - Homework 13 Update #1 - Page 5 of 8 Select an option (use integer value only): 2 Palindrome Option - The current Fraction is a Palindrome! MENU - HW #3 1. Initializing 2. ispalindrome) . 3. Using displayCommonPalindroneDigit() 4. Printing . 5. Quit Select an option (use integer value only): 3 displayCommonPalindromeDigit() Option - There is/are 1 common digit(s) of 5 . . MENU - HW #3 1. Initializing 2. ispalindrone() 3. Using displayConnonPalindromeDigit() 4. Printing . 5. Quit Select an option (use integer value only): 1 INITIALIZING Option Calling runMenuInit()! SUBMENU - INITIALIZING 1. Creating 2. Updating 3. Returning Select an option (integer only): 2 Updating an EXISTING Fraction object -- Calling update! Enter num: 156810000 Enter denom: 49914173 SubMENU - INITIALIZING 1. Creating 2. Updating 3. Returning Select an option (integer only): 3 Returning to previous menu! CIS 25 Spring 2021 - Homework #3 Update #1 - Page 6 of 8 MENU - HW #3 1. Initializing 2. ispalindrome 3. Using displayCommonPalindromeDigit() 4. Printing . 5. Quit Select an option (use integer value only): 4 PRINTING Option - Address: 0041FDD4 num: 156810eee denom : 49914173 MENU - HW #3 1. Initializing 2. ispalindrome() 3. Using displayCommonPalindromeDigit() 4. Printing . 5. Quit Select an option (use integer value only): 2 Palindrome Option - The current Fraction is not a Palindrome! . MENU - HW #3 1. Initializing 2. ispalindrome() 3. Using displayCommonPalindromeDigit() 4. Printing 5. Quit Select an option (use integer value only): 3 displayCommonPalindromeDigit() Option - The current Fraction is not a Palindrome! . MENU - HW #3 1. Initializing 2. ispalindrome) 3. Using displayCommonPalindromeDigit() 4. Printing 5. Quit Select an option (use Integer value only): 1 INITIALIZING Option - Calling runMenu Init()! SubMENU - INITIALIZING 1. Creating CIS 25 Spring 2021 - Homework #3 Update #1 - Page 7 of 8 2. Updating 3. Returning . Select an option (integer only): 1 Please update or return! ... SubMENU - INITIALIZING 1. Creating 2. Updating 3. Returning Select an option (integer only): 3 Returning to previous menu! . . . MENU - HW #3 1. Initializing 2. ispalindrome) 3. Using displayConnonPalindroneDigit() 4. Printing 5. Quit Select an option (use integer value only): 1 Having fun ...! D. Save the program as cis25Spring2021 Your NameHw3.cpp Reminder! In your program, no GLOBAL DATA are allowed, and you must write all needed functions (no library functions are allowed - Except for cin and cout and their functions/manipulators). All user-created objects must be dynamie All dynamic allocations must be released properly! Name your application driver program as cis25Spring2021 Your Name Hw3.cpp For submission, test your output with data as above Attach the output at the end of your application program (as comment), And, again followed with a comment block about your logie, code issues, and any other comments that you may have - You MUST PROVIDE this comment block even with a "No Comments!" as content of this block . Note! . You are only allowed to use cout and cin from the iostream include header CIS 25 Spring 2021 - Homework 13 Update #1 - Page 8 of 8 . You are not allowed to use any other classes or syntax structures that are not introduced in class and class meetings - please confirm with the instructor if you have any doubt! . You are not allowed to use classes, struct's, and functions written by someone else. . You must create all classes, struct's, and functions on your own for usage in all of required class works. The values of the elements from the created array, it any, MUST NOT be changed/modified at all during the analysis steps and process unless they are required to be updated or changed based on the specified tasks. All struct, class, and type names must have the initials of your first and last names at the end. All local variables must be declard at the top of its function. All variable names must have the initials of your first and last names at the end. All function names must have your complete firstname and initial of your lastname at the end. All filenames must have your complete firstname and initial of your lastname as required. All filenames must have your complete firstname and initial of your last name as required. CIS 25 Spring 2021 - Homework #3 Update #1 - Page 1 of 8 Turn In: 1. Exercise #1 - Due on Tuesday, March 15, 2021 by 11:00pm Email Submission a) For each exercise, a package must be generated to include the following items: Copy of your source file (C++ program)- your source file MUST BE NAMED 25 cis25Spring2021 Your Name Hw3.cpp Besides the submitting the above driver, create and submit - fractionYourName.h . fractionYour Name.cpp fractionutility Your Name.h - fractionutility Your Name.cpp hw3Utility.h hw3Utility Your Name.cpp Copy of output (copy and paste to the end of your program as PROGRAM_OUTPUT comment block) Copy of Logic_code_Output_Issues (as a separate comment block) after the "PROGRAM_OUTPUT" block. b) Emailing each package as follows. One email message for each exercise, The SUBJECT line of the message should have the following line cis25Spring2021 Your NameHw3.cpp Attaching the source file that was created in part a). 2. Q.E.D. CIS 25 Spring 2021 - Homework #3 Update 31 - Page 2 of 8 1. Code Assignment/Exercise Exercise 1 A. Update the Fraction class given in the Lecture notes or as discussed in class meetings as follows. 1. Add your FIRST NAME and the initial of your last name to the name Traction and use this as your updated class. For examples, if your first name is John Smith then update the class name to be FractionJohns 2. Add and update all class constructors for your Fraction class to handle the initialization appropriately There must be as least 3 constructors of (1) Default: and Copy, and (in) Fraction(int n, int d) Euch constructor should print the confirmation (e.g. "Calling Fraction()". "Calling Fraction (const Fraction)" or "Calling Praction (int, int>"). 3. Provide a destructor with a confirmation when removing the object (ie, "Calling -Fraction()) 4. Provide get(/set() member functions for each private member data. 5. A member function print that will print the current Fraction object. B. Provide the following member functions, a. A member function isPalindrome(), which is a predicate, to return true/false if the Fraction object is a Palindrome, and b. A function displayCommon PalindromeDigit(); and c. Aged() helper to reduce the Fraction object; and C. Provide the following stand-alone functions, d. A function init() to set up or update the required Fraction object. c. An appropriate run Menuw30) function to produce the required output as displayed below; and 1. Other functions as needed C. Run a driver/program named as cis25spring2e21 Your Name w3.cpp and record the output shown below (a) The output screen should have the following lines displayed before any other display or input can be seen, CIS 25 - C++ programming Laney College YourName Information -- Assignment: Implemented by: HA #3 Exercise #1 Your Name CIS 25 Spring 2021 - Homework #3 Update #1 - Page 3 of 8 Submitted Date: 2021/03/15 Current Number of LEB available: ? Allowed Number of LEB Used: Remaining Number of LEB: (b) Then, the output screen should be followed by a sample output as follows. MENU - HWW3 . 1. Initializing . 2. ispalindrome) 3. Using displayConnonPalindromeDigit() 4. Printing 5. Quit Select an option (use integer value only): WRONG OPTION! MENU - HW33 . 1. Initializing . 2. isPalindrome() 3. Using displayConnonPalindromeDigit() 4. Printing S. Quit Select an option (use integer value only): 2 Palindrome Option - Not a proper option as there is no Fraction . . MENU - HW3 1. Initializing 2. isPalindrone() 3. Using displayCommonPalindroneDigit() 4. Printing . 5. Quit Select an option (use integer value only): 1 INITIALIZING Option - Calling runMenuInit()! SubMENU - INITIALIZING 1. Creating 2. Updating . 3. Returning Select an option (integer only): 2 Not a proper option as there is no Fraction! CIS 25 Spring 2021 - Homework #3 Update #1 - Page 4 of 8 SubMENU - INITIALIZING 1. Creating 2. Updating 3. Returning Select an option (integer only): 5 WRONG OPTION! SUBMENU - INITIALIZING 1. Creating 2. Updating . 3. Returning Select an option (integer only): 1 Creating 1 NEW Fraction object -- Calling create()! Enter num: 5 Enter denon -959 SubMENU INITIALIZING 1. Creating 2. Updating . 3. Returning Select an option (integer only): 3 Returning to previous menul . MENU - HW3 1. Initializing . 2. isPalindrome) 3. Using displayComoPalindroneDigit() 4. Printing . 5. Quit Select an option (use integer value only): 4 PRINTING Option - Address : 8041F0D4 num t -5 denon ! 959 MENU - HW #3 . 1. Initializing 2. ispalindrone) 3. Using displayCommon PalindromeDigit() 4. Printing 5. Quit . . CIS 25 Spring 2021 - Homework 13 Update #1 - Page 5 of 8 Select an option (use integer value only): 2 Palindrome Option - The current Fraction is a Palindrome! MENU - HW #3 1. Initializing 2. ispalindrome) . 3. Using displayCommonPalindroneDigit() 4. Printing . 5. Quit Select an option (use integer value only): 3 displayCommonPalindromeDigit() Option - There is/are 1 common digit(s) of 5 . . MENU - HW #3 1. Initializing 2. ispalindrone() 3. Using displayConnonPalindromeDigit() 4. Printing . 5. Quit Select an option (use integer value only): 1 INITIALIZING Option Calling runMenuInit()! SUBMENU - INITIALIZING 1. Creating 2. Updating 3. Returning Select an option (integer only): 2 Updating an EXISTING Fraction object -- Calling update! Enter num: 156810000 Enter denom: 49914173 SubMENU - INITIALIZING 1. Creating 2. Updating 3. Returning Select an option (integer only): 3 Returning to previous menu! CIS 25 Spring 2021 - Homework #3 Update #1 - Page 6 of 8 MENU - HW #3 1. Initializing 2. ispalindrome 3. Using displayCommonPalindromeDigit() 4. Printing . 5. Quit Select an option (use integer value only): 4 PRINTING Option - Address: 0041FDD4 num: 156810eee denom : 49914173 MENU - HW #3 1. Initializing 2. ispalindrome() 3. Using displayCommonPalindromeDigit() 4. Printing . 5. Quit Select an option (use integer value only): 2 Palindrome Option - The current Fraction is not a Palindrome! . MENU - HW #3 1. Initializing 2. ispalindrome() 3. Using displayCommonPalindromeDigit() 4. Printing 5. Quit Select an option (use integer value only): 3 displayCommonPalindromeDigit() Option - The current Fraction is not a Palindrome! . MENU - HW #3 1. Initializing 2. ispalindrome) 3. Using displayCommonPalindromeDigit() 4. Printing 5. Quit Select an option (use Integer value only): 1 INITIALIZING Option - Calling runMenu Init()! SubMENU - INITIALIZING 1. Creating CIS 25 Spring 2021 - Homework #3 Update #1 - Page 7 of 8 2. Updating 3. Returning . Select an option (integer only): 1 Please update or return! ... SubMENU - INITIALIZING 1. Creating 2. Updating 3. Returning Select an option (integer only): 3 Returning to previous menu! . . . MENU - HW #3 1. Initializing 2. ispalindrome) 3. Using displayConnonPalindroneDigit() 4. Printing 5. Quit Select an option (use integer value only): 1 Having fun ...! D. Save the program as cis25Spring2021 Your NameHw3.cpp Reminder! In your program, no GLOBAL DATA are allowed, and you must write all needed functions (no library functions are allowed - Except for cin and cout and their functions/manipulators). All user-created objects must be dynamie All dynamic allocations must be released properly! Name your application driver program as cis25Spring2021 Your Name Hw3.cpp For submission, test your output with data as above Attach the output at the end of your application program (as comment), And, again followed with a comment block about your logie, code issues, and any other comments that you may have - You MUST PROVIDE this comment block even with a "No Comments!" as content of this block . Note! . You are only allowed to use cout and cin from the iostream include header CIS 25 Spring 2021 - Homework 13 Update #1 - Page 8 of 8 . You are not allowed to use any other classes or syntax structures that are not introduced in class and class meetings - please confirm with the instructor if you have any doubt! . You are not allowed to use classes, struct's, and functions written by someone else. . You must create all classes, struct's, and functions on your own for usage in all of required class works. The values of the elements from the created array, it any, MUST NOT be changed/modified at all during the analysis steps and process unless they are required to be updated or changed based on the specified tasks. All struct, class, and type names must have the initials of your first and last names at the end. All local variables must be declard at the top of its function. All variable names must have the initials of your first and last names at the end. All function names must have your complete firstname and initial of your lastname at the end. All filenames must have your complete firstname and initial of your lastname as required. All filenames must have your complete firstname and initial of your last name as required

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

Students also viewed these Databases questions