Instructions 1. Download the starter package from Canvas, you are given 2 template files: main.cpp. Makefile, and 3 test

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

Instructions 1. Download the starter package from Canvas, you are given 2 template files: main.cpp. Makefile, and 3 test

Post by answerhappygod »

Instructions 1 Download The Starter Package From Canvas You Are Given 2 Template Files Main Cpp Makefile And 3 Test 1
Instructions 1 Download The Starter Package From Canvas You Are Given 2 Template Files Main Cpp Makefile And 3 Test 1 (38.39 KiB) Viewed 37 times
Instructions 1 Download The Starter Package From Canvas You Are Given 2 Template Files Main Cpp Makefile And 3 Test 2
Instructions 1 Download The Starter Package From Canvas You Are Given 2 Template Files Main Cpp Makefile And 3 Test 2 (64.21 KiB) Viewed 37 times
Instructions 1 Download The Starter Package From Canvas You Are Given 2 Template Files Main Cpp Makefile And 3 Test 3
Instructions 1 Download The Starter Package From Canvas You Are Given 2 Template Files Main Cpp Makefile And 3 Test 3 (25.87 KiB) Viewed 37 times
Instructions 1 Download The Starter Package From Canvas You Are Given 2 Template Files Main Cpp Makefile And 3 Test 4
Instructions 1 Download The Starter Package From Canvas You Are Given 2 Template Files Main Cpp Makefile And 3 Test 4 (25.87 KiB) Viewed 37 times
Instructions 1 Download The Starter Package From Canvas You Are Given 2 Template Files Main Cpp Makefile And 3 Test 5
Instructions 1 Download The Starter Package From Canvas You Are Given 2 Template Files Main Cpp Makefile And 3 Test 5 (45.15 KiB) Viewed 37 times
Instructions 1. Download the starter package from Canvas, you are given 2 template files: main.cpp. Makefile, and 3 test objects that you should not temper with: sub.h, sub.o, input.txt. sub.h and sub.o contain the header and the binary of a pre-built function ready to use: int sub(int n, int "A, int "B, int "C); While a sample input.txt always looks like this: 5 123 345 567 789 9 10 11 The first line defines the number of lines that follow. Each following line always contains 3 integers, separated by whitespaces. 2. In main.cpp, implement the following steps: a. Load the first line of input.txt into an integer variable n; b. Dynamically initialize three integer arrays of size n: A, B, and C;
c. Load each column starting from the second line of input.txt respectively into A, B, and C. E.g. A will become [1, 3, 5, 7, 9], B=(2, 4, 6, 8, 10], and likewise C [3, 5, 7, 9, 11]. = d. Call the sub function with sub(n, A, B, C); and write the function's result into a new file output.txt. 3. Change the given Makefile so that your code compiles into a working binary program that executes the implementations above. Rubrics We will measure your performance based on the following checklist: 1. You have turned in an appropriate Documentation readme. (1pt) 2. You have turned in an appropriately modified Makefile. (1pt) 3. Your code generates correct outputs with the grader's own test input files. (2pt) 4. Your code handles File I/O and Dynamic Memory Allocation correctly. (1pt) We will build your program with the Makefile you turn in. E.g. If your code fails to build on the general ASU server, then you will get at most (1/5). What to Turn In, One More Time . A zip/tar archive containing the following: omain.cpp Makefile O 0 O A README.txt with your name in it that documents what your program is doing ** You DO NOT need to turn in sub.o, input.txt and output.txt since they will be replaced anyways during grading
D main.cpp X 1 2 8 9 10 HENHE OHNM456 11 12 13 14 15 16 #include "sub.h" #include <iostream> #include <fstream> int main() 8( } int n; // Your work starts here // int result = sub (n, A, B, C); return 0; 1
File Edit Search View Encoding Language Settings Tools Macro Run Plugins |pc| 1 main.cpp X 1 input txt X Makefile X sub.h X int sub (int n, int *A, int *B, int *C);
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply