============== =========== ====== 1. Given the structures defined below: struct dataType{ int integer; float decimal; ch

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

============== =========== ====== 1. Given the structures defined below: struct dataType{ int integer; float decimal; ch

Post by answerhappygod »

1 Given The Structures Defined Below Struct Datatype Int Integer Float Decimal Ch 1
1 Given The Structures Defined Below Struct Datatype Int Integer Float Decimal Ch 1 (76.96 KiB) Viewed 27 times
Answer Number 5 Only!!!!!!!!!!!
Answer Number 5 Only!!!!!!!!!!!
Answer Number 5 Only!!!!!!!!!!!
Answer Number 5 Only!!!!!!!!!!!
Answer Number 5 Only!!!!!!!!!!!
============== =========== ====== 1. Given the structures defined below: struct dataType{ int integer; float decimal; char ch; }; struct node Type { dataType e; nodeType* next; }; Assume the data structures shown above, write a driver function called buildEvenSLL that takes two nodeType pointer references, ori and evenSLL. The driver function should build the evenSlL linked list with only values from the linked list referenced by ori whose integer value is even. (15pts) * PASTE CODE HERE*/ 2. Define a class called FractionType to represent numerator and denominator of a fraction. The class should have mutator, accessor, and default constructor functions. Also, include the member function definitions listed below: (40pts) O A public member function called print that takes no parameters. The member function must print data values in the form of a fraction. o A public member function called validate with no parameters. The member function check if the denominator is not a zero. The member function should return true if the denominator is a zero, otherwise, it should return false. *PASTE CODE HERE -- The content of the implementation file only*/ 3. Write a driver function definition called add that takes as its parameters two FractionType objects. The driver function should add two fractions together and return a FractionType object. Remember that the denominators of fractions cannot be 0. (Hint: validate each fraction before performing the addition operation. Also, do not to reduce the FractionType object to its simplest form.) (15pts) *PASTE CODE HERE*/ 4. Write a function called findMinMax that takes a integer array, integer reference to the minimum value, integer reference to the maximum value, and its size as parameters. The function should find both the minimum and maximum values in the integer array. Return the minimum and maximum values back to the calling function. (15pts) * PASTE CODE HERE*/ 5. Write a full program to include the necessary preprocessor directives, the function prototypes, the main function, and the function calls to the defined functions in questions 3 and 4. To properly call the previously listed functions, the main function must declare integer array of size 8, an input file stream, and three instances of FractionType (fracl, frac2, and frac3). Include code to initialize the integer array with values from a file. Initialize the frac1 and frac2 instances with values from a file. Remember to print the contents of all array structures and FractionType instances after initialization to the console. Be sure to call the above listed functions properly with the appropriate parameters. If the denominator of any of FractionType objects are zero, display the message: "Cannot perform operation!" to the console. Otherwise, display the results of the add function call to the console. (30pts) attach the code and screenshot of a successful run on the program. * PASTE CODE HERE*/
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply