1. Homepage
  2. Programming
  3. CPT106 C++ Programming and Software Engineering II

CPT106 C++ Programming and Software Engineering II

Engage in a Conversation
C++CPT106C++ Programming and Software Engineering

 Assessment Overview

This assessment aims at testing basic concepts of C++ programming, such as inheritance, information hiding, overloading, friend functions, vector, constructor and related software engineering concepts. The marking criteria are as follows: CourseNana.COM

  CourseNana.COM

Problem 1 (5 marks) CourseNana.COM

  CourseNana.COM

Write a function CourseNana.COM

Int[] union_Array (int a[], int lenA, int b[], int lenB) CourseNana.COM

that constructs the union of two integer arrays and removes any element that occurs more than once. For example, if two arrays of the union_Array are {1, 8, 16 } and {11, 8, 7, 1}, it will return an array of {1, 8, 16, 11, 7}. CourseNana.COM

  CourseNana.COM

Tasks: CourseNana.COM

1. The length of two arrays should be different and defined by constants using “#define”. (1 mark) CourseNana.COM

2. Arrays are inputted from the keyboard.(1 mark) CourseNana.COM

3. Call the function union_Array in your main function. Initialize two arrays. Print out the new array (there is no requirement for the order of the output elements). (1 marks) CourseNana.COM

4. Compile and run correctly(2 marks) CourseNana.COM

  CourseNana.COM

Problem 2 (5 marks)   CourseNana.COM

  CourseNana.COM

Given a student class to represent student information as follows: CourseNana.COM

class Student{ CourseNana.COM

string stuId; CourseNana.COM

string name; CourseNana.COM

double mathScore; CourseNana.COM

double chineseScore; CourseNana.COM

double englishScore; CourseNana.COM

}; CourseNana.COM

Write a program to achieve the following tasks: CourseNana.COM

1. Use an array to save student information. The length of the array should be defined by a constant using “const”. (1 mark) CourseNana.COM

2. Student information is inputted from the keyboard. (1 mark) CourseNana.COM

3. Print out the student ID and average mark of three courses for each student in a descending sequence.(1 mark) CourseNana.COM

4. Print out student ID whose average mark is smaller than the average mark of all students.(1 mark) CourseNana.COM

5. Compile and run correctly. (2 marks) CourseNana.COM

  CourseNana.COM

Problem 3 (5 marks) CourseNana.COM

  CourseNana.COM

Given a student structure to represent student information as follows: CourseNana.COM

structure student{ CourseNana.COM

string stuId; CourseNana.COM

string name; CourseNana.COM

double mathScore; CourseNana.COM

double chineseScore; CourseNana.COM

double englishScore; CourseNana.COM

}; CourseNana.COM

  CourseNana.COM

Write a program to achieve the following tasks: CourseNana.COM

1. Use a pointer and linked list to save student information. The length of the linked list (number of student objects) should be inputted from the keyboard. (1 mark) CourseNana.COM

2. Student information is inputted from the keyboard. (1 mark) CourseNana.COM

3. Print out the student ID and average mark of three courses for each student in a descending sequence. (1 mark) CourseNana.COM

4. Print out student ID whose average mark is smaller than the average mark of all students. (1 mark) CourseNana.COM

5. Compile and run correctly. (1 mark) CourseNana.COM

  CourseNana.COM

Problem 4 (5 marks) CourseNana.COM

  CourseNana.COM

Given a function header as char *findC (char const *source, char const *obj): CourseNana.COM

Write a program to achieve the following tasks: CourseNana.COM

1. Write a function to search a character sequence pointed to by a pointer (called “obj”), in another character sequence (called “source”). Return the pointer pointing to the found character. If there is more than one target found in the source, return the pointer pointing to the first one. (2 marks) CourseNana.COM

  CourseNana.COM

Eg1: search for “C” in “ABCDEF”, return the pointer point to ‘C’. CourseNana.COM

Eg2: search for “Z” in “ABCDEF”, return a NULL pointer. CourseNana.COM

Eg3: search for “CD” in “ABCDEF”, return the pointer point to ‘C’. CourseNana.COM

Eg4: search for “CF” in “ABCDEF”, return a NULL pointer. CourseNana.COM

Eg5: search for “A” in “ABCAFC”, return the pointer point to the first ‘A’. CourseNana.COM

2. Write a main function to input two strings by the keyboard and print the position of the pointer in the source string(print -1 if the function returns a NULL pointer). (1 mark) CourseNana.COM

3. Compile and run correctly. (2 marks) CourseNana.COM

  CourseNana.COM

  CourseNana.COM

Problem 5 (10 marks) CourseNana.COM

Given a circle class to represent circle information as follows: CourseNana.COM

class Circle{ CourseNana.COM

int x; CourseNana.COM

int y; CourseNana.COM

double radius; CourseNana.COM

}; CourseNana.COM

Write a program to achieve the following tasks: CourseNana.COM

1. The centre point of (x,y) and radius should be inputted from the keyboard. (1 mark) CourseNana.COM

2. Define a method that can calculate and return the circle’s area. (1 marks) CourseNana.COM

3. Define an overloading operator + to add two circle objects and get a new circle object. The centre point of the new circle object is the same as the centre point of the first circle object. The area of the new circle object should be the sum of the areas of two circle objects (You can calculate the radius of the new circle based on the sum of the area of two circles). (2 marks) CourseNana.COM

CPT106 Assessment 1 CourseNana.COM

4. Define a function to print relations of two circles(interaction, tangency, separation and inside) (2 marks) CourseNana.COM

5. Define a main function to input two circle objects, get a new circle object based on these two circle objects and print the relations of these two circle objects. (2 marks) CourseNana.COM

6. Compile and run correctly. (2 marks) CourseNana.COM

  CourseNana.COM

Get in Touch with Our Experts

WeChat (微信) WeChat (微信)
Whatsapp WhatsApp
C++代写,CPT106代写,C++ Programming and Software Engineering代写,C++代编,CPT106代编,C++ Programming and Software Engineering代编,C++代考,CPT106代考,C++ Programming and Software Engineering代考,C++help,CPT106help,C++ Programming and Software Engineeringhelp,C++作业代写,CPT106作业代写,C++ Programming and Software Engineering作业代写,C++编程代写,CPT106编程代写,C++ Programming and Software Engineering编程代写,C++programming help,CPT106programming help,C++ Programming and Software Engineeringprogramming help,C++assignment help,CPT106assignment help,C++ Programming and Software Engineeringassignment help,C++solution,CPT106solution,C++ Programming and Software Engineeringsolution,