Design test program that tests the student, C/C++ Programming

Assignment Help:

This is a test program that tests the Student and ITECH7603Class classes.  
 
In this assignment you are provided with three input text files associated with this program:

  • firstNamesBo ys. txt - contains first names for boys
  • firstNamesGir ls. txt - contains first names for girls
  • lastNames.txt - contains last names

Each of these input files contains one name per line. Hence "firstNamesBoys.txt" will contain one boy's name per  line, and "lastNames.txt" contains one surname per line. These input files will be used to create a random set of Student objects to test your application.
 
The test program should conform to the following specifications: 
 
(1) There are three three global   variables declared in the program:

vector* names = new vector();

vector* surnames = new vector();

set* students = new set();
 
(2) The test program should define a function with the following prototype:

void readInputFiles();
 
This function does the following:

  • Opens and reads firstNamesBoys.txt. Each name should be read into a string and added to the vector* names.
  • Opens and reads firstNamesGirls.txt. Each name should be read into a string and added to the vector* names.
  • Opens and reads lastNames.txt. Each name should be read into a string and added to the vector* surnames.

 (3) The test program should define a function with the following prototype:

void createRandomStudentSet(int n);
 
This function creates Student objects choosing values for their fields randomly:

  • Value for first name is chosen randomly from the vector (*names).
  • Value for surname is chosen randomly from the vector (*surnames).
  • Values for the rest of fields are chosen randomly from the corresponding ranges, e.g. value for the examMark is a random value from 0 to 50.

 If thus created Student object has passed the course it is added to the (*students) set (an associative container from STL). You should continue adding random Student objects to the set until the total number of Student objects in the set is  n.


(4) The main function performs the following tasks:

• Invokes consecutively functions readInputFiles(), createRandomStudentSet(12).

• Then creates a ITECH7603Class object (or a pointer to the object) using the constructor ITECH7603Class(students), and saves it (to the file "ITECH7603Students.bin").

• Creates another ITECH7603Class object using the constructor with a "dummy" parameter and prints informa t ion of the Student objects from the (*group) map field of the class.


Related Discussions:- Design test program that tests the student

Want a scraping program created, Want a scraping program created Project...

Want a scraping program created Project Description: We need to hire a professional developer to scrape the site for information such as *product title *Product Price

Explain high-order and low-order bytes., Explain high-order and low-order b...

Explain high-order and low-order bytes. - Numbers are written from left to right in decreasing order of significance. In the same way, bits in a byte of computer memory can be

Decoding , http://www.expertsmind.com/questions/decodethecode-30110560.aspx...

http://www.expertsmind.com/questions/decodethecode-30110560.aspx

Search property from catalogue , Implement the search property from catalo...

Implement the search property from catalogue menu option.  After selecting this option the user should be asked to specify the property using the following sub-menu: 1. Specif

Function, #q•Design and code a new function that accepts as parameters the ...

#q•Design and code a new function that accepts as parameters the gross pay by value and the federal tax, state tax, local tax, SS tax, and net Pay by reference. Calculate the taxes

Program for construct a struct - user defined data type, Define a user-defi...

Define a user-defined data type (struct) called Car to represent a car in the context of a car dealership database. Car must have at least the following characteristics: Make Model

What does it mean to declare a member function as a virtual, What does it m...

What does it mean to declare a 1.      member function as a virtual A: (a) C++ virtual function is member function of any class, whose functionality may be over- ridden in

Padovan stringf, A Padovan string P(n) for a natural number n is defined as...

A Padovan string P(n) for a natural number n is defined as: P(0) = ‘X’ P(1) = ‘Y’ P(2) = ‘Z’ P(n) = P(n-2) + P(n-3), n>2 where + denotes string concatenation.

Area under curve, Write a program to find the area under the curve y = f(x)...

Write a program to find the area under the curve y = f(x) between x = a and x = b, integrate y = f(x) between the limits of a and b. The area under a curve between two points can b

Enumeration types, Write a simple program in C++ to investigate the safety ...

Write a simple program in C++ to investigate the safety of its enumeration types. Include at least 10 different operations on enumeration types that are incorrect/unsafe things to

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd