Student Class(30 points)Create a class named Student that

1. Student Class(30 points)Create a class named Student that ha s three member variables:• name – A string for the name of the student.• numClasses – An integer for how many courses the student is currently enrolled in.• classList – An array of strings for the names of the classes the student is enrolled in.Write appropriate constructor(s), mutator (set), and accessor (get) methods for the classalong with the following:• A function that inputs all values from the user, including the list of class names.• A function that outputs the name and list of all courses.• A function that resets the number of classes to 0 and the classList to an empty array(with null strings).The main() should test all of these functions. It should perform the following steps in a loop:• It should ask the user to input a student’s data.• Display the entered data back (in a well-formatted way).2• Ask the user if they want to enter the data again (y/n).• If ’n’, then the program ends, otherwise it should clear the student class object andrepeat the loop (ask the user to enter new data…).Note: The statement ‘cin >> variable;’ leaves a newline character in the buffer. This can bea problem if you are mixing ‘cin >> variable;’ and the ‘getline’ function (that reads a lineof input). Use ‘cin.ignore’ function to discard the newline character after using ‘cin’.Filename: student.cpp2. BoxOfProduce Class (30 points)Your Community Supported Agriculture (CSA) farm delivers a box of fresh fruits andvegetables to your house once a week. For this programming project, define the classBoxOfProduce that contain s exactly three bundles of fruits or vegetables. You canrepresent the fruits or vegetables as an array of type string. Add appropriate constructorsand accessor/mutator functions to get or set the fruits or vegetables stored in the array.Also write an output function that displays the complete contents of the box on theconsole.Next, write a main function that creates a BoxOfProduce with three items randomly selectedfrom this list:• Broccoli• Tomato• Kiwi• Kale• TomatilloDo not worry if your program randomly selects duplicate produce for the three items. Next,the main function should display the contents of the box and allow the user to substituteany one of the five possible fruits or vegetables for any of the fruits or vegetables selectedfor the box. After the user is done with substitutions it should output the final contents ofthe box to be delivered. Then it should ask if the user wants to create another box and ifyes, it should repeat the above steps. It should keep doing so until the user chooses not tocreate another box of produce.Finally, add a static variable to your class that keeps track of the total number of boxes ofproduce created and a static function that returns that value. Display this value in the mainfunction at the end of each iteration of the main loop.Filename: produce.cpp33. Operator Overloading (40 points)Define a class for rational numbers. A rational number is a number that can be representedas the quotient of two integers. For example, 1/2, 3/4, 64/2, and so forth are all rationalnumbers. (By 1/2 and so on we mean that everyday fractions, not the integer division thisexpression would produce in a C++ program.) Represent rational numbers as two values oftype int, one for the numerator and one for the denominator. Call the class Rational. Includea constructor with two arguments that can be used to set the member variables of an objectto any legitimate values. Also include a constructor that has only a single parameter of typeint; call this single parameter wholeNumber and define the constructor so that the objectwill be initialized to the rational number wholeNumber /1. Include a default constructor thatinitializes an object to 0 (that is, 0/1). Overload the input and output operators >> and, >=, +, -, *, and /. The main() shouldtest your class and the functions.Hints: Two rational numbers a/b and c/d are equal if a*d equals c*b. If b and d are positiverational numbers, a /b is less than c /d provide d a*d is less than c *b. You should includea function to normalize the values stored so that, after normalization, the denominator ispositive and the numerator and denominator are as small as possible. For example, afternormalization 4/-8 would be represented the same as -1/2.Filename: rational.cpp

 

CLICK HERE TO ORDER A SIMILAR PAPER

We pride ourselves in writing quality essays

CLICK HERE TO CONTACT US

Lets Start Working

Plagiarism Free

We use anti-plagiarism software to ensure you get high-quality, unique papers. Besides, our writers have a zero plagiarism mentality

On Time Delivery

Your essay will be delivered strictly within the deadline.  If you have an urgent order, we can do it!

Money Back Guarantee

We offer warranty service, including free revisions, and a right to request a refund incase your expectations are not met!

THE BEST PAPER WRITER HELPER

Our Advantage

  • Say “NO” to plagiarism – FREE plagiarism report as an addition to your paper
  • The lowest prices that fit excellent quality
  • Authorship – you are the one who possesses the paper. We DO NOT re-sale or re-use any of them.

OUR PAPER WRITER HELPER GOODIES

Our Freebies

  • Free Cover Page
  • Free Revisions
  • Free Reference Page
  • Free 24/7 support

Pin It on Pinterest

Share This