Lab 4.1
Lab 4.1
Lab 4.1
After answering each of the questions be sure to capture the output of one
execution of your program to a text file / word doc. Also, be sure to save a copy of
your code, you may
need a functioning version to answer one of the subsequent questions.
1) Write a function named printN that takes an int n, a string s, and returns
void. This function must print the string s, n times.
2) Write a function called multTable that returns void, takes in an int row and,
int col and prints the multiplication table from 1 up to the two integers.
For example, a call to this function like... multTable(3, 5) prints…
1 2 3 4 5
2 4 6 8 10
3 6 9 12 15
Extra credit: print the output as neatly as possible. When attempting this
think about the way we handle numbers greater than 10, what about greater
than 100? The goal is to keep everything in neat rows and columns so the
spacing between entries makes them clear. In the example above, 10, 12
and 15 offset the columns so they are not neatly spaced. To answer this
question you must solve this problem for any given m and n. This requires a
separate solution from the main question.
4) Write a function called shorten that takes in one string and returns a
string. The string that is returned is the same string that was entered, but
without vowels.
For example: shorten("Hello World!") returns “H ll W rld!”
(notice the e and o's were all dropped. TIP: be thorough with your
testing)