Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Class Diagram Worksheet C++ 3) Class name is Fraction has the attributes: numerator (an integer) and denominator (an integer). The methods should include a default

Class Diagram Worksheet C++

3) Class name is Fraction has the attributes: numerator (an integer) and denominator (an integer). The methods should include a default constructor with default values of 1 for each attribute, a set function for each attribute, a setAll function that sets values for both attributes, a get function for each attribute, a decimalValue function that returns the quotient as a decimal, a ratioValue that returns the ratio (example: 3/7).

Create a class diagram

Create the class specification/interface

Create a class implementation

Constructor sets all of the attributes to 0

A set function for each attribute

The set function for denominator must validate parameter because it can not be 0. If 0, then set denominator to 1

A setAll function that accepts two integer and assigns them to the attributes

A get function for each attribute that returns the value of the attribute

A decimalValue function that returns the quotient as a decimal

A ratio function that returns the reduced ratio of numerator/denominator

Suppose the ratio is 6/14, the function will return the reduced equivalent of 3/7 as a string

Need to use a greatest common divisor algorithm

Add the class interface and implementation to a test driver

Class Diagram Worksheet C++

4) Class name is StudentModel has the attributes: a list of Student objects, size of the Student list (an integer), active status (a Boolean). The methods should include a constructor that loads the student data into the Student list from a data file, an add function that adds a student to the end of the list, a remove function that sets active status to false, a findPosition function that accepts a position in the list and returns a students first and last name at that given position (0 to list size minus 1), a findName function that accepts a last name and displays the full name and list position all of the students with the last name, a listSize function that returns the size of the list, a sort function that organizes the list by either student last name or average score.

Create a class diagram

Create the class specification/interface

Create a class implementation

Constructor loads the Student list from a data file

An add function that adds a student to the end of the list

A remove function that accepts student last name, calls the findName function and prompts the user to select position from the list, then sets active status to false if and only if the student name is found.

A findPosition function that accepts a position in the list and returns a students first and last name at that given position (0 to list size minus 1

A findName function that accepts a last name and displays the full name and list position all of the students with the last name

A listSize function that returns the size of the list,

A sort function that organizes the list by either student last name or average score.

Add the class interface and implementation to a test driver

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

Database Systems Design Implementation And Management

Authors: Peter Robb,Carlos Coronel

5th Edition

061906269X, 9780619062699

More Books

Students also viewed these Databases questions

Question

DISCUSS the key elements of Canada's labour laws.

Answered: 1 week ago