Question: Name: Student#: SODV1101 Programming Fundamentals Term Year Assignment 3 Instructor: Instructor Name Date: YYW-MM-DD Directions: 0 Written questions can be submitted via soft copy or
Name: Student#: SODV1101 Programming Fundamentals Term Year Assignment 3 Instructor: Instructor Name Date: YYW-MM-DD Directions: 0 Written questions can be submitted via soft copy or a scanned document and submitted by d2l dropbox, as a single doc le or single pdf le. Questions and answers should be written clearly and coherently. Programming questions are completed using Visual Studio. - Assignments must be submitted by the posted due date, or be subject to the course's late policy. Work must be completed individually and in accordance with the academic integrity policy. a All codes shown in this assignment are compiled and tested except for questions that aim to find errors in a C++ program. a For all written questions, you may assume that the usual header files are included as follows: #include #include #include using namespace std; Note: The assignment's written questions not submitted as a single file will not be graded! Written Questions - Quality / 20 Functionality [50 Total [100I Assignment 3: Written Questions 1. Give concise answers to the following questions / 10 a) What are Null Pointers? Can a pointer store address of cells of an array? Give [1+2 examples. in) What are the address-of and the dereference operators, and what do they do? [2+2 c) What is the difference between pass-by-value and pass-by-reference? f3 4/10 2. /10 What are the values of the variables a, b, and c after the function call 15 q2a (a, b, c) completes in the program below? void q2a(int& x, int& y, int z) for ( ; x > 0; - -x) if (y using namespace std; int main() { string repeat = \"Y"; while (repeat == "Y\"); { int count; cout > count; double data = new doub1e[count]; cout ) data[i]; cout 3 repeat; } while (repeat != "Y\" && repeat != "N") } return 6; After the fix, the following will be a sample input/output from the above code: How many numbers are on your list? 3 Enter the numbers: 45 57 12 List in reverse order: 12 67 45 Try another list? [YINIY How many numbers are on your list? 4 Enter the numbers: 1 2 3 4 List in reverse order: 4 3 2 1 Try another list? [YleN Process returned 0 {0x0} execution time : 22.005 5 \fProgram 1: Complex Numbers Learning Objective - Use Structures to group related but dissimilar data types. 0 Summarize how memory is addressed inside a computer. I Decide where to use the \"pass-by-value" or the "pass-by-reference" technique based on application purpose and the programming need. 0 Demonstrate logical thinking by using programming syntax and strategies. Declare a structure to represent a complex number {a number having a real part and an imaginary part). Write C++ functions to add, subtract, and multiply two complex numbers. Hints: Addition: (a+bi) + {c+di) = (a+c) + (b+d)i Subtraction: (a+bi) - lc+di) = (a-c) + {b-dli Multiplication: (a+bi) * (c+di) = (ac bd) + (ad + bc)i To know more about complex numbers, please visit: https:f/www.mathsisfun.comumbers/complex-numbers.html Sample input/output: Please enter the first complex number: Enter real and imaginary parts only: [Please separate inputs by space or the enter key and do not use 'i' after the complex part) 4 -8 Please enter the second complex number: Enter real and imaginary parts only: [Please separate inputs by space or the enter key and do not use 'i' after the complex part) 2 -4 Addition = 6-12i subtraction = 2-4i multiplication = -24-32i Process returned 0 l0x0) execution time : 14.684 5 Press any key to continue. Program 2: Student Rank List Learning Objective 0 Use Structures to group related but dissimilar data types. 0 Summarize how memory is addressed inside a computer. 0 Decide where to use the "pass-by-value" or the \"pass-by-reference\" technique based on application purpose and the programming need. 0 Demonstrate logical thinking by using programming syntax and strategies. Create a structure to store details of 'n' students (id, name, marks in five subjects). Randomly populate all student's records (use random id in range (100 to 999), random name, random marks in range (20.. 100)). Create a function to display a list of students based on their average marks (descending). Finally, display students who have failed in more than one subject (consider 40 as the pass mark). Sample Input/Output: Please enter the total students: 5 Randomly populated students: Student Id: 737, Name: CYEAJXOT. Average Marks: 70.2 Subjects marks: 94, 95, 22, 41, 99, Student Id: 551, Name: NSBRQ, Average Marks: 67.6 Subjects marks: 94, 82, 68, 56, 38, Student Id: 432, Name: BQEU, Average Marks: 49.6 Subjects marks: 54,99, 32, 21, 42, Student Id: 450, Name: HLLQZI, Average Marks: 57.4 Subjects marks: 88, 29, 74, 76. 20. Student Id: 175, Name: MAKUT, Average Marks: 49 Subjects marks: 43, 51, 74, 55, 22, List of sorted students according to their average marks: Student Id: 737, Name: CYEAJXOT, Average Marks: 702 Subjects marks: 94, 95, 22, 41, 99, Student Id: 551, Name: NSBRQ. Average Marks: 67.6 Subjects marks: 94, 82, 68, 56, 38, Student Id: 450, Name: HLLQZI, Average Marks: 57.4 Subjects marks: 88, 29, 74, 76, 20, Student Id: 432, Name: BQEU, Average Marks: 49.6 Subjects marks: 54,99, 32, 21, 42, Student Id: 175, Name: MAKUT, Average Marks: 49 Subjects marks: 43, 51, 74, 55, 22, List of students who failed in more than one subject: Student Id: 450, Name: HLLQZI, Average Marks: 57.4 Subjects marks: 88, 29, 74, 76, 20, Student Id: 432, Name: BQEU, Average Marks: 49.6 Subjects marks: 54, 99, 32, 21, 42, Process returned 0(010) execution time : 0,831 5 Press any key to continue. Evaluation This assignment has 2 main components, assigned marks as follows: Task Marks Written Questions 30 Code Quality and Functionality 70 Total 100 Marks for written questions are indicated beside each question. The following rubrics will be followed for assessing the program code: Excellent (100%) Competent (80%) Satisfactory (50%) Unsatisfactory (0%) Code contains no compile-time errors. Code contains no logical errors. Code produces the exact correct output and does not crash for valid inputs. Code is well organized, clear, and easy to read. Code is consistent throughout and comments are used where needed. Code contains no compile-time errors. Code produces the exact correct output except for a few formatting issues / incorrect data type issues. Code does not crash for valid inputs. Code produces the correct output most of the time. However, for some valid inputs, it shows the incorrect output. Minor logical errors are present. Code contains no compile-time errors. Code is disorganized or could use some refactoring. Code contains major logical errors and does not match the expected output. Code contains compile-time errors. Code contains major logical errors. Code is very dhj'icult to read. Code does not execute
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
Students Have Also Explored These Related Programming Questions!