Question: Write one single complete C++ program to do all two sections below: (Program must be able to compile ) Part A: (from pract3.pdf) Write a

Write one single complete C++ program to do all two sections below: (Program must be able to compile )

Part A: (from pract3.pdf)

Write a function called smallCol that calculates and returns the smallest possible sum of entries of any column in a 2-dimensional array.

For example, a program that uses the function smallCol follows.

int main() {

int x[2][3] = {{3, 1, 4}, {1, 5, 9}};

cout << "Smallest column sum = " << smallCol (x, 2, 3) << endl;

// from the 2-d array x that has size 2 x 3, find the smallest col sum

// output will be 4 since col#0 contains 3 and 1 is smallest.

return 0;

}

Part B: Write 3 functions:

toUpperCase converts all the characters in the given String to upper case.

Note: Do not use toupper or tolower functions. Refer to Dr. Ryba's code from:

http://venus.cs.qc.edu/~ryba/cs111/Ch7/charArith.cpp

toLowerCase converts all the characters in the given String to lower case.

equals determines if both string are the same.

Program asks user to input two strings in main ().

Then, it will display them in uppercase and lowercase values.

Finally, it will check and see if both strings are equal.

Sample I/O #1

Please enter two words: hello hello Words in uppercase: HELLO HELLO Words in lowercase: hello hello

Both strings are equal.

Sample I/O #2

Please enter two words: Hello hellO Words in uppercase: HELLO HELLO Words in lowercase: hello hello

The input strings are different.

Sample I/O #3

Please enter two words: 333 333

Words in uppercase: 333 333

Words in lowercase: 333 333 Both strings are equal.

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!