Creating objects of the Currency class requires a name (string), a currency symbol (string) and the number of decimal places (integer) usually associated with the currency (in that order).

C++

LANGUAGE:  C++ CHALLENGE: Creating objects of the Currency class requires a name (string), a currency symbol (string) and the number of decimal places (integer) usually associated with the currency (in that order). Define an object named curr, of type Currency corresponding to “US Dollar” with the symbol “$” and 2 decimal places.

Read More

Consider a class Movie that contains the following information about a movie: * Title * MPAA Rating (e.g. G, PG, PG-13, R) * Number of people who rated this movie as a 1 * Number of people who rated this movie as a 2 * Number of people who rated this movie as a 3 * Number of people who rated this movie as a 4 * Number of people who rated this movie as a 5

C++

LANGUAGE:  C++ CHALLENGE: Consider a class Movie that contains the following information about a movie: * Title * MPAA Rating (e.g. G, PG, PG-13, R) * Number of people who rated this movie as a 1 * Number of people who rated this movie as a 2 * Number of people who rated this movie…

Read More

Design a class called Date that has integer data members to store month, day, and year. The class should have a three-parameter (day-of-month, month, year) default constructor that allows the date to be set at the time a new Date object is created.

C++

LANGUAGE: C++ CHALLENGE: Design a class called Date that has integer data members to store month, day, and year. The class should have a three-parameter (day-of-month, month, year) default constructor that allows the date to be set at the time a new Date object is created. If the user creates a Date object without passing any…

Read More

Write a full class definition for a class named Averager, and containing the following members: An data member named sum of type integer. An data member named count of type integer.

C++

LANGUAGE: C++ CHALLENGE: Write a full class definition for a class named Averager, and containing the following members: An data member named sum of type integer. An data member named count of type integer. A constructor with no parameters. The constructor initializes the data members sum and the data member count to 0. A function named…

Read More

Given three variables, k, m, n, of type int that have already been declared and initialized, write some code that prints each of them in a 9 position field on the same line. For example, if their values were 27, 987654321, -4321, the output would be: |xxxxxxx27987654321xxxx-4321

C++

LANGUAGE: C++ CHALLENGE: Given three variables, k, m, n, of type int that have already been declared and initialized, write some code that prints each of them in a 9 position field on the same line. For example, if their values were 27, 987654321, -4321, the output would be: |xxxxxxx27987654321xxxx-4321 NOTE: The vertical bar, |, on…

Read More