Question: 1.1 Hello from you (2-pt) Write a C++ program to print the following banner to the console: Hello from (your name) Have programmed in: (List

 1.1 Hello from you (2-pt) Write a C++ program to print

1.1 Hello from you (2-pt) Write a C++ program to print the following banner to the console: Hello from (your name) Have programmed in: (List languages you know) | Specific requirements: You must print those "+1" characters that make up the boundary of the banner There is a space between the left edge and the first character of each string You could output more than 3 lines of text in total, but see below You must make the banner wide enough to accommodate the longest string, but not too wide for it to have more than one trailing space Important: you must achieve the above in an automatic way, That is, you don't manually assign fixed number of '-' or spaces, or a literal string, to have a fitting boundary . In other word, your program would always generate a fitting boundary with any reasonably-sized string for the third line. Hint, you may use the string class (from ), which has a member function .length() It's up to you on whether to create helper functions, though it's recommended 1.2 Finding non-trivial divisors for a sequence of integers from a file, writing results to another file (3-pt) Write a C++ program to do the following: Read from a text file "input.txt", which has one integer on each line and should assume the values as given in the example below For each integer, produce all of its divisors other than 1 and itself (they are called non-trivial divisors), separated by a comma. . If it's prime number, produce the word "None" In the example code on lecture notes, we enumerated all possible values less than the number itself But you only need to reach sqrt (num) to find all factors and you should take this approach in this assignment o Save the other factors (>sqrt(num)) in an array Write a reverseArray() function to reverse the array so factors are in ascending order Write a swapInt(int& il, int& i2) function, which is called by reverseArray ( ) Output all factors into a separate file, "output.txt", in a format as shown in the example below Example Given the file input.txt 36 48 13 49 27 The output.txt file should look like the following 36 : 2, 3, 4, 6, 9, 12, 18 48 : 2, 3, 4, 6, 8, 12, 16, 24 13 : None 49 : 7 27 : 3, 9

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
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 Databases Questions!