Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Question 1 Consider the following structure used to keep employee records: struct Employee string firstNine; string lastName; float salary; Turn the employee record into a

image text in transcribedimage text in transcribed
Question 1 Consider the following structure used to keep employee records: struct Employee string firstNine; string lastName; float salary; Turn the employee record into a class type rather than a structure type. The employee record class should have private member variables for all the data. Include public member functions for each of the following: . a default constructor that sets the employee's first name and last name to a blank string, and his annual salary to 0; an overloaded constructor that sets the member variables to specified values; member functions to set each of the member variables to a value given as an argument to the function (Le. mulalors); member functions to retrieve the data from each of the member variables (Le Embed your class definition in a test program. The test program should create two Employee objects and display each object's annual salary. Use the overloaded continu carlo initialize one of the Employee records as Joe Soap with an annual salary of R1 45600.00. Obtain the following input values for the other Employee record from the keyboard: Joanne Soape R154 480.66Now give each employee a 10%% rake and display each Employan object's annual .LEBe ARES Quesion 2 Design and implement a C+ + class called Module that handles information regarding your assignments for a specific module. Think of all the things you would want to do with such a class and wile comesponding member functions for your Module class. Your class declaration should be well-documented so that users will know how to use 1. Al a minimum your class Module should contain information on the module code, the module name, the marks for assignments, the year mark and the final mark. Test your class in a small program where you instantiate an object of the class, initialize the member variables that represents the assignment marks, calculate a year mark and display the year mark. Quesion 3 Implement your class Module from question 2, as an abstract data datatype (ADT) using separate compilation, so that separate files are used for the interface and implementation. While a main program that does the following: Declare an any of all your modules. The elements of the array must be of objects of the class Module. . Initialise the array with the modules you are registered for. Obtain the module codes, names of modules and assignment marks from the user. Initialize each module with the assignment marks you have obtained for the module (or would like to obtain for the module). Determine your semester mark for each module: the first assignment contributes 30%% and the second assignment 70%%. Display the semester marks. Adjust the marks for Assignment 2 for COS 1512 with +5%. Determine your semester mark for COS1512 again to see what ellect the update had. . Display an updated list of your semester marks for all the modules you are registered for. Enrichment exercise: Adapt the application program to use a vector instead of an analy. It should not be necessary to change the class interface or implementation file in any way

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_2

Step: 3

blur-text-image_3

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

Introduction to Wireless and Mobile Systems

Authors: Dharma P. Agrawal, Qing An Zeng

4th edition

1305087135, 978-1305087132, 9781305259621, 1305259629, 9781305537910 , 978-130508713

More Books

Students also viewed these Programming questions

Question

What is the difference between a CPU and a GPU?

Answered: 1 week ago

Question

What are the various principles of material handling ?

Answered: 1 week ago

Question

Explain the process planning.

Answered: 1 week ago

Question

What do you mean by 'make or buy decision ' ?

Answered: 1 week ago