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

Iteration problem, my program does not run more than 9 iterations when ever...

my program does not run more than 9 iterations when ever i want to iterate more than 100 iterations. what is the reason and how to tackle?

Get all table list from current database , i am using otlv4 for database co...

i am using otlv4 for database connecttvity, while i try to get all tables list from current database using query "$SQLTables" no output is displayed though programe compiles coretl

C program for even & odd no in any matrices , C Program for EVEN & ODD NO I...

C Program for EVEN & ODD NO IN ANY MATRICES #include stdio.h> #include conio.h> void main() {           int a[100][100];           int i=0,j=0,r,c,even=0,odd=0;

Minimum shelf, At a shop of marbles, packs of marbles are prepared. Packets...

At a shop of marbles, packs of marbles are prepared. Packets are named A, B, C, D, E …….. All packets are kept in a VERTICAL SHELF in random order. Any numbers of packets with thes

3n+1, Consider the following algorithm to generate a sequence of numbers. S...

Consider the following algorithm to generate a sequence of numbers. Start with an integer n. If n is even, divide by 2. If n is odd, multiply by 3 and add 1. Repeat this process wi

Flowcharts, push and pop operation using array draw flowcharts

push and pop operation using array draw flowcharts

Write program.., # Dear I want help to programmer that write C++ code for...

# Dear I want help to programmer that write C++ code for my small project as soon as posible If we can help me?..

Convert a cov-cpe file to a tif image file, Convert a COV/CPE (Micosoft Fax...

Convert a COV/CPE (Micosoft Fax Cover Page) file to a TIF image file Project Description: I would like a small API written that will take a COV/CPE file and replaced the corr

Keywords in cpp, Define Keywords in C++ K e y w o r d s: ...

Define Keywords in C++ K e y w o r d s: K e y w o rd s a r e t h e w o rd s a l r e a d y u s e d b y C + + i n i t s c

Linear iterative process, (a) Write a recursive procedure (digits n) that c...

(a) Write a recursive procedure (digits n) that computes the number of digits in the integer n using a linear recursive process. For example, (digits 42) should return 2 and (digit

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